diff options
author | peter <peter@FreeBSD.org> | 1996-08-12 17:03:30 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1996-08-12 17:03:30 +0000 |
commit | 4485ba15572bfb57c5d32b1c2610d78bf969f5e2 (patch) | |
tree | ba1ceaba00057d39708061f838d46a49ff125cb9 /usr.bin | |
parent | c1c3cbd0e165e5770db4588b9aeffeea352b5671 (diff) | |
download | FreeBSD-src-4485ba15572bfb57c5d32b1c2610d78bf969f5e2.zip FreeBSD-src-4485ba15572bfb57c5d32b1c2610d78bf969f5e2.tar.gz |
Add a simple -v (verbose) option that allows you to see when -C actually
installs something. This is not 100% right, since it has a false hit
when install -C snaps hard links.
Also, run strip(1) from the $PATH, otherwise you need a special version
of install to install (say) elf binaries which have a different strip.
With JDP's elfkit, the layout of the path determines which binary format
you are generating.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/xinstall/xinstall.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/usr.bin/xinstall/xinstall.c b/usr.bin/xinstall/xinstall.c index 90c1d42..5489927 100644 --- a/usr.bin/xinstall/xinstall.c +++ b/usr.bin/xinstall/xinstall.c @@ -40,7 +40,7 @@ static const char copyright[] = #ifndef lint /*static char sccsid[] = "From: @(#)xinstall.c 8.1 (Berkeley) 7/21/93";*/ static const char rcsid[] = - "$Id: xinstall.c,v 1.7 1996/04/08 10:59:36 joerg Exp $"; + "$Id: xinstall.c,v 1.8 1996/06/23 12:59:18 bde Exp $"; #endif /* not lint */ /*- @@ -79,7 +79,7 @@ static const char rcsid[] = #include "pathnames.h" -int debug, docompare, docopy, dopreserve, dostrip; +int debug, docompare, docopy, dopreserve, dostrip, verbose; int mode = S_IRWXU|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH; char *group, *owner, pathbuf[MAXPATHLEN]; char pathbuf2[MAXPATHLEN]; @@ -126,7 +126,7 @@ main(argc, argv) char *flags, *to_name; iflags = 0; - while ((ch = getopt(argc, argv, "Ccdf:g:m:o:ps")) != EOF) + while ((ch = getopt(argc, argv, "Ccdf:g:m:o:psv")) != EOF) switch((char)ch) { case 'C': docompare = docopy = 1; @@ -161,6 +161,9 @@ main(argc, argv) case 's': dostrip = 1; break; + case 'v': + verbose = 1; + break; case '?': default: usage(); @@ -394,6 +397,10 @@ different: (void)utime(to_name, &utb); } moveit: + if (verbose) { + printf("install: %s -> %s\n", + from_name, old_to_name); + } if (rename(to_name, old_to_name) < 0) { serrno = errno; unlink(to_name); @@ -557,8 +564,8 @@ strip(to_name) errno = serrno; err(EX_TEMPFAIL, "fork"); case 0: - execl(_PATH_STRIP, "strip", to_name, NULL); - err(EX_OSERR, "exec(" _PATH_STRIP ")"); + execlp("strip", "strip", to_name, NULL); + err(EX_OSERR, "exec(strip)"); default: if (wait(&status) == -1 || status) { (void)unlink(to_name); |