install: ignore -s
The -s flag previously called strip(1) on the installed file. This patch changes install(1)'s behaviour to ignore -s. Many makefiles use the -s flag, so it has to be recognised for compatibility, however it does not have to do anything because symbols do not negatively affect the functionallity of binaries. Ignoring -s have the added benefit that the user do not need to edit makefiles if they want the symbols that are useful for debugging. If the user wants to strip away symbols, it can be done manually or automatically by the package manager. Laslo: Update the man-date and remove -s from usage() Signed-off-by: Mattias Andrée <maandree@kth.se>
This commit is contained in:
parent
b7fb3a58e7
commit
609169d600
11
xinstall.1
11
xinstall.1
|
@ -1,4 +1,4 @@
|
||||||
.Dd 2016-02-12
|
.Dd 2016-24-27
|
||||||
.Dt INSTALL 1
|
.Dt INSTALL 1
|
||||||
.Os sbase
|
.Os sbase
|
||||||
.Sh NAME
|
.Sh NAME
|
||||||
|
@ -12,7 +12,7 @@
|
||||||
.Po
|
.Po
|
||||||
.Fl d Ar dir ...
|
.Fl d Ar dir ...
|
||||||
|
|
|
|
||||||
.Op Fl sD
|
.Op Fl D
|
||||||
.Po
|
.Po
|
||||||
.Fl t Ar dest
|
.Fl t Ar dest
|
||||||
.Ar source ...
|
.Ar source ...
|
||||||
|
@ -62,10 +62,6 @@ is copied with
|
||||||
Change the installed files' owner to
|
Change the installed files' owner to
|
||||||
.Ar owner .
|
.Ar owner .
|
||||||
This may be a user name or a user identifier.
|
This may be a user name or a user identifier.
|
||||||
.It Fl s
|
|
||||||
Remove unnecessary symbols using
|
|
||||||
.Xr strip 1 .
|
|
||||||
Failure to strip a file does not imply failure to install the file.
|
|
||||||
.It Fl t Ar dest
|
.It Fl t Ar dest
|
||||||
Copy files into the directory
|
Copy files into the directory
|
||||||
.Ar dest .
|
.Ar dest .
|
||||||
|
@ -79,8 +75,7 @@ notation is used, the base mode is 0000.
|
||||||
.Xr chmod 1 ,
|
.Xr chmod 1 ,
|
||||||
.Xr chown 1 ,
|
.Xr chown 1 ,
|
||||||
.Xr cp 1 ,
|
.Xr cp 1 ,
|
||||||
.Xr mkdir 1 ,
|
.Xr mkdir 1
|
||||||
.Xr strip 1
|
|
||||||
.Sh STANDARDS
|
.Sh STANDARDS
|
||||||
The
|
The
|
||||||
.Nm
|
.Nm
|
||||||
|
|
26
xinstall.c
26
xinstall.c
|
@ -13,7 +13,6 @@
|
||||||
#include "text.h"
|
#include "text.h"
|
||||||
|
|
||||||
static int Dflag = 0;
|
static int Dflag = 0;
|
||||||
static int sflag = 0;
|
|
||||||
static gid_t group;
|
static gid_t group;
|
||||||
static uid_t owner;
|
static uid_t owner;
|
||||||
static mode_t mode = 0755;
|
static mode_t mode = 0755;
|
||||||
|
@ -41,22 +40,6 @@ make_dirs(char *dir, int was_missing)
|
||||||
make_dir(dir, was_missing);
|
make_dir(dir, was_missing);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
strip(const char *filename)
|
|
||||||
{
|
|
||||||
pid_t pid = fork();
|
|
||||||
switch (pid) {
|
|
||||||
case -1:
|
|
||||||
eprintf("fork:");
|
|
||||||
case 0:
|
|
||||||
execlp("strip", "strip", "--", filename, (char *)0);
|
|
||||||
eprintf("exec: strip:");
|
|
||||||
default:
|
|
||||||
waitpid(pid, NULL, 0);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
install(const char *s1, const char *s2, int depth)
|
install(const char *s1, const char *s2, int depth)
|
||||||
{
|
{
|
||||||
|
@ -125,9 +108,6 @@ install(const char *s1, const char *s2, int depth)
|
||||||
eprintf("fclose %s:", s2);
|
eprintf("fclose %s:", s2);
|
||||||
if (fclose(f1) == EOF)
|
if (fclose(f1) == EOF)
|
||||||
eprintf("fclose %s:", s1);
|
eprintf("fclose %s:", s1);
|
||||||
|
|
||||||
if (sflag)
|
|
||||||
strip(s2);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lchown(s2, owner, group) < 0)
|
if (lchown(s2, owner, group) < 0)
|
||||||
|
@ -139,7 +119,7 @@ install(const char *s1, const char *s2, int depth)
|
||||||
static void
|
static void
|
||||||
usage(void)
|
usage(void)
|
||||||
{
|
{
|
||||||
eprintf("usage: %s [-g group] [-o owner] [-m mode] (-d dir ... | [-Ds] (-t dest source ... | source ... dest))\n", argv0);
|
eprintf("usage: %s [-g group] [-o owner] [-m mode] (-d dir ... | [-D] (-t dest source ... | source ... dest))\n", argv0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -166,7 +146,7 @@ main(int argc, char *argv[])
|
||||||
Dflag = 1;
|
Dflag = 1;
|
||||||
break;
|
break;
|
||||||
case 's':
|
case 's':
|
||||||
sflag = 1;
|
/* no-op for compatibility */
|
||||||
break;
|
break;
|
||||||
case 'g':
|
case 'g':
|
||||||
gflag = EARGF(usage());
|
gflag = EARGF(usage());
|
||||||
|
@ -184,7 +164,7 @@ main(int argc, char *argv[])
|
||||||
usage();
|
usage();
|
||||||
} ARGEND
|
} ARGEND
|
||||||
|
|
||||||
if (argc < 1 + (!tflag & !dflag) || dflag & (Dflag | sflag | !!tflag))
|
if (argc < 1 + (!tflag & !dflag) || dflag & (Dflag | !!tflag))
|
||||||
usage();
|
usage();
|
||||||
|
|
||||||
if (gflag) {
|
if (gflag) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user