diff options
author | ache <ache@FreeBSD.org> | 2000-09-15 08:05:37 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 2000-09-15 08:05:37 +0000 |
commit | d58c3debc91741b2f3251a0dd9c79eee21424eb0 (patch) | |
tree | 748ca170a8182438fdff43803be1ccd5432ddee7 /usr.sbin/mtree | |
parent | 12daa03d595b05ad279374bf328d1c3240c1154b (diff) | |
download | FreeBSD-src-d58c3debc91741b2f3251a0dd9c79eee21424eb0.zip FreeBSD-src-d58c3debc91741b2f3251a0dd9c79eee21424eb0.tar.gz |
Restore standard symlink default, return -L, remove -P, add missing -q to getopt
This is part of whole subsystem fixing
Reviewed by: imp
Diffstat (limited to 'usr.sbin/mtree')
-rw-r--r-- | usr.sbin/mtree/mtree.8 | 9 | ||||
-rw-r--r-- | usr.sbin/mtree/mtree.c | 14 |
2 files changed, 12 insertions, 11 deletions
diff --git a/usr.sbin/mtree/mtree.8 b/usr.sbin/mtree/mtree.8 index ee30e84..06e0eb8 100644 --- a/usr.sbin/mtree/mtree.8 +++ b/usr.sbin/mtree/mtree.8 @@ -40,7 +40,7 @@ .Nd map a directory hierarchy .Sh SYNOPSIS .Nm mtree -.Op Fl PUcdeinqrux +.Op Fl LUcdeinqrux .Bk -words .Op Fl f Ar spec .Ek @@ -70,9 +70,10 @@ missing from either the file hierarchy or the specification. .Pp The options are as follows: .Bl -tag -width flag -.It Fl P -Don't follow symbolic links in the file hierarchy, instead consider -the symbolic link itself in any comparisons. +.It Fl L +Follow all symbolic links in the file hierarchy (by default +.Nm +considers the symbolic link itself). .It Fl U Modify the owner, group and permissions of existing files to match the specification and create any missing directories or symbolic links. diff --git a/usr.sbin/mtree/mtree.c b/usr.sbin/mtree/mtree.c index d16771e..2aa4c51 100644 --- a/usr.sbin/mtree/mtree.c +++ b/usr.sbin/mtree/mtree.c @@ -57,7 +57,7 @@ static const char rcsid[] = extern long int crc_total; -int ftsoptions = FTS_LOGICAL; +int ftsoptions = FTS_PHYSICAL; int cflag, dflag, eflag, iflag, nflag, qflag, rflag, sflag, uflag, Uflag; u_int keys; char fullpath[MAXPATHLEN]; @@ -77,7 +77,7 @@ main(argc, argv) keys = KEYDEFAULT; init_excludes(); - while ((ch = getopt(argc, argv, "cdef:iK:k:np:Prs:UuxX:")) != -1) + while ((ch = getopt(argc, argv, "cdef:iK:k:Lnp:qrs:UuxX:")) != -1) switch((char)ch) { case 'c': cflag = 1; @@ -106,6 +106,10 @@ main(argc, argv) if (*p != '\0') keys |= parsekey(p, NULL); break; + case 'L': + ftsoptions &= ~FTS_PHYSICAL; + ftsoptions |= FTS_LOGICAL; + break; case 'n': nflag = 1; break; @@ -115,10 +119,6 @@ main(argc, argv) case 'q': qflag = 1; break; - case 'P': - ftsoptions ^= FTS_LOGICAL; - ftsoptions |= FTS_PHYSICAL; - break; case 'r': rflag = 1; break; @@ -170,7 +170,7 @@ static void usage() { (void)fprintf(stderr, -"usage: mtree [-PUcdeinqrux] [-f spec] [-K key] [-k key] [-p path] [-s seed]\n" +"usage: mtree [-LUcdeinqrux] [-f spec] [-K key] [-k key] [-p path] [-s seed]\n" "\t[-X excludes]\n"); exit(1); } |