summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/mtree/mtree.89
-rw-r--r--usr.sbin/mtree/mtree.c8
2 files changed, 11 insertions, 6 deletions
diff --git a/usr.sbin/mtree/mtree.8 b/usr.sbin/mtree/mtree.8
index 06e0eb8..fae66e8 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 LUcdeinqrux
+.Op Fl LPUcdeinqrux
.Bk -words
.Op Fl f Ar spec
.Ek
@@ -71,9 +71,10 @@ missing from either the file hierarchy or the specification.
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).
+Follow all symbolic links in the file hierarchy.
+.It Fl P
+Don't follow symbolic links in the file hierarchy, instead consider
+the symbolic link itself in any comparisons. This is the default.
.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 2aa4c51..331e669 100644
--- a/usr.sbin/mtree/mtree.c
+++ b/usr.sbin/mtree/mtree.c
@@ -77,7 +77,7 @@ main(argc, argv)
keys = KEYDEFAULT;
init_excludes();
- while ((ch = getopt(argc, argv, "cdef:iK:k:Lnp:qrs:UuxX:")) != -1)
+ while ((ch = getopt(argc, argv, "cdef:iK:k:LnPp:qrs:UuxX:")) != -1)
switch((char)ch) {
case 'c':
cflag = 1;
@@ -113,6 +113,10 @@ main(argc, argv)
case 'n':
nflag = 1;
break;
+ case 'P':
+ ftsoptions &= ~FTS_LOGICAL;
+ ftsoptions |= FTS_PHYSICAL;
+ break;
case 'p':
dir = optarg;
break;
@@ -170,7 +174,7 @@ static void
usage()
{
(void)fprintf(stderr,
-"usage: mtree [-LUcdeinqrux] [-f spec] [-K key] [-k key] [-p path] [-s seed]\n"
+"usage: mtree [-LPUcdeinqrux] [-f spec] [-K key] [-k key] [-p path] [-s seed]\n"
"\t[-X excludes]\n");
exit(1);
}
OpenPOWER on IntegriCloud