From: millert Date: Thu, 17 Apr 1997 19:13:55 +0000 (+0000) Subject: Add support for STRIP environment variable to specify where strip(1) X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=c8713ba15e810a6bf0864266fbf4966c0a7cbed1;p=openbsd Add support for STRIP environment variable to specify where strip(1) lives. Idea from NetBSD. --- diff --git a/usr.bin/xinstall/install.1 b/usr.bin/xinstall/install.1 index ff056abc606..38aaf1f11ed 100644 --- a/usr.bin/xinstall/install.1 +++ b/usr.bin/xinstall/install.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: install.1,v 1.4 1996/08/08 20:49:27 millert Exp $ +.\" $OpenBSD: install.1,v 1.5 1997/04/17 19:13:55 millert Exp $ .\" $NetBSD: install.1,v 1.4 1994/11/14 04:57:17 jtc Exp $ .\" .\" Copyright (c) 1987, 1990, 1993 @@ -121,9 +121,11 @@ rename fails, the existing target is left untouched. .It Fl s .Nm Install exec's the command -.Xr strip 1 +.Pa /usr/bin/strip to strip binaries so that install can be portable over a large -number of systems and binary types. +number of systems and binary types. If the environment variable +.Ev STRIP +is set, it is used instead. .El .Pp By default, @@ -155,6 +157,15 @@ option, temporary files named INS@XXXXXX, where XXXXXX is decided by .Xr mkstemp 3 , are created in the target directory. +.Sh ENVIRONMENT +.Nm +utilizes the following environment variables. +.Bl -tag -width "STRIP" +.It Ev STRIP +For an alternate +.Xr strip 1 +program to run. Default is +.Pa /usr/bin/strip . .Sh SEE ALSO .Xr chflags 1 , .Xr chgrp 1 , diff --git a/usr.bin/xinstall/xinstall.c b/usr.bin/xinstall/xinstall.c index 3d642627609..ed05f796eb0 100644 --- a/usr.bin/xinstall/xinstall.c +++ b/usr.bin/xinstall/xinstall.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xinstall.c,v 1.12 1997/03/07 01:57:08 millert Exp $ */ +/* $OpenBSD: xinstall.c,v 1.13 1997/04/17 19:13:58 millert Exp $ */ /* $NetBSD: xinstall.c,v 1.9 1995/12/20 10:25:17 jonathan Exp $ */ /* @@ -44,7 +44,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)xinstall.c 8.1 (Berkeley) 7/21/93"; #endif -static char rcsid[] = "$OpenBSD: xinstall.c,v 1.12 1997/03/07 01:57:08 millert Exp $"; +static char rcsid[] = "$OpenBSD: xinstall.c,v 1.13 1997/04/17 19:13:58 millert Exp $"; #endif /* not lint */ #include @@ -509,6 +509,10 @@ strip(to_name) char *to_name; { int serrno, status; + char *path_strip; + + if (issetugid() || (path_strip = getenv("STRIP")) == NULL) + path_strip = _PATH_STRIP; switch (vfork()) { case -1: @@ -516,8 +520,8 @@ strip(to_name) (void)unlink(to_name); errx(EX_TEMPFAIL, "forks: %s", strerror(serrno)); case 0: - execl(_PATH_STRIP, "strip", to_name, NULL); - warn("%s", _PATH_STRIP); + execl(path_strip, "strip", to_name, NULL); + warn("%s", path_strip); _exit(EX_OSERR); default: if (wait(&status) == -1 || status)