summaryrefslogtreecommitdiffstats
path: root/usr.sbin/mtree
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2000-07-24 02:57:27 +0000
committermarcel <marcel@FreeBSD.org>2000-07-24 02:57:27 +0000
commit35aeef29b58a4f4acf20b4a13f1326e85affab9e (patch)
treeced8795733e33db132f2f62aec92501324813745 /usr.sbin/mtree
parent3dd3bc9aca4a3fd5c51e4beaf6937ab597969b8b (diff)
downloadFreeBSD-src-35aeef29b58a4f4acf20b4a13f1326e85affab9e.zip
FreeBSD-src-35aeef29b58a4f4acf20b4a13f1326e85affab9e.tar.gz
Revert the reversion of the default mtree behaviour. The mtree
command now follows symlinks again. Requested by: jkh
Diffstat (limited to 'usr.sbin/mtree')
-rw-r--r--usr.sbin/mtree/mtree.89
-rw-r--r--usr.sbin/mtree/mtree.c14
2 files changed, 11 insertions, 12 deletions
diff --git a/usr.sbin/mtree/mtree.8 b/usr.sbin/mtree/mtree.8
index b3ecffc..fe93f57 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 LUcdeinrux
+.Op Fl PUcdeinrux
.Bk -words
.Op Fl f Ar spec
.Ek
@@ -70,10 +70,9 @@ missing from either the file hierarchy or the specification.
.Pp
The options are as follows:
.Bl -tag -width flag
-.It Fl L
-Follow all symbolic links in the file hierarchy (by default
-.Nm
-considers the symbolic link itself).
+.It Fl P
+Don't follow symbolic links in the file hierarchy, instead consider
+the symbolic link itself in any comparisons.
.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 2411586..aa3d1ea 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_PHYSICAL;
+int ftsoptions = FTS_LOGICAL;
int cflag, dflag, eflag, iflag, nflag, 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:Lnp:rs:UuxX:")) != -1)
+ while ((ch = getopt(argc, argv, "cdef:iK:k:np:Prs:UuxX:")) != -1)
switch((char)ch) {
case 'c':
cflag = 1;
@@ -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 [-LUcdeinrux] [-f spec] [-K key] [-k key] [-p path] [-s seed]\n"
+"usage: mtree [-PUcdeinrux] [-f spec] [-K key] [-k key] [-p path] [-s seed]\n"
"\t[-X excludes]\n");
exit(1);
}
OpenPOWER on IntegriCloud