summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>2000-07-16 07:55:07 +0000
committerache <ache@FreeBSD.org>2000-07-16 07:55:07 +0000
commitcf90e1b59591af15eaed07fedb9e1acadef22874 (patch)
tree0f22b3a302ac6890de2790b4c363294251845696 /usr.sbin
parentf045b6ecd23b883f4730d69ea92027e1cd185aa8 (diff)
downloadFreeBSD-src-cf90e1b59591af15eaed07fedb9e1acadef22874.zip
FreeBSD-src-cf90e1b59591af15eaed07fedb9e1acadef22874.tar.gz
Revert back to original mtree default behaviour to not follow symlinks, to be
compatible with other *BSD camp. Add -L option to follow symlinks, so remove -P option which is now default. The next step will be to add -L to building process. Asked-by: bde
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/mtree/mtree.89
-rw-r--r--usr.sbin/mtree/mtree.c12
2 files changed, 11 insertions, 10 deletions
diff --git a/usr.sbin/mtree/mtree.8 b/usr.sbin/mtree/mtree.8
index 8a2ce7a..bca96f2 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 PUcdeinrux
+.Op Fl cdeiLnrUux
.Bk -words
.Op Fl f Ar spec
.Ek
@@ -97,6 +97,10 @@ to the current set of keywords.
Use the ``type'' keyword plus the specified (whitespace or comma separated)
.Ar keywords
instead of the current set of keywords.
+.It Fl L
+Follow all symbolic links in the file hierarchy (by default
+.Nm mtree
+consider the symbolic link itself).
.It Fl n
Do not emit pathname comments when creating a specification. Normally
a comment is emitted before each directory and before the close of that
@@ -105,9 +109,6 @@ directory when using the
option.
.It Fl p Ar path
Use the file hierarchy rooted in
-.It Fl P
-Don't follow symbolic links in the file hierarchy, instead consider
-the symbolic link itself in any comparisons.
.Ar path ,
instead of the current directory.
.It Fl r
diff --git a/usr.sbin/mtree/mtree.c b/usr.sbin/mtree/mtree.c
index b994cd2..4a49ccb 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, rflag, sflag, uflag, Uflag;
u_int keys;
char fullpath[MAXPATHLEN];
@@ -106,16 +106,16 @@ 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;
case 'p':
dir = optarg;
break;
- case 'P':
- ftsoptions ^= FTS_LOGICAL;
- ftsoptions |= FTS_PHYSICAL;
- break;
case 'r':
rflag = 1;
break;
@@ -167,7 +167,7 @@ static void
usage()
{
(void)fprintf(stderr,
-"usage: mtree [-cdeinrUux] [-f spec] [-K key] [-k key] [-p path] [-s seed]\n"
+"usage: mtree [-cdeiLnrUux] [-f spec] [-K key] [-k key] [-p path] [-s seed]\n"
"\t[-X excludes]\n");
exit(1);
}
OpenPOWER on IntegriCloud