FreeBSD Bugzilla – Attachment 10920 Details for
Bug 21725
mtree follows symlinks!
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 2.64 KB, created by
jez
on 2000-10-03 13:00:00 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
jez
Created:
2000-10-03 13:00:00 UTC
Size:
2.64 KB
patch
obsolete
>Index: mtree.8 >=================================================================== >RCS file: /usr/cvs/src/usr.sbin/mtree/mtree.8,v >retrieving revision 1.16.2.3 >diff -u -r1.16.2.3 mtree.8 >--- mtree.8 2000/06/30 09:54:06 1.16.2.3 >+++ mtree.8 2000/10/02 17:01:14 >@@ -40,7 +40,7 @@ > .Nd map a directory hierarchy > .Sh SYNOPSIS > .Nm mtree >-.Op Fl cdeinrUux >+.Op Fl cdeiLnPrUux > .Op Fl f Ar spec > .Op Fl K Ar keywords > .Op Fl k Ar keywords >@@ -85,6 +85,8 @@ > Use the ``type'' keyword plus the specified (whitespace or comma separated) > .Ar keywords > instead of the current set of keywords. >+.It Fl L >+Symbolic links in file hierarchies are followed (default). > .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 >@@ -95,6 +97,8 @@ > Use the file hierarchy rooted in > .Ar path , > instead of the current directory. >+.It Fl P >+No symbolic links are followed. > .It Fl r > Remove any files in the file hierarchy that are not described in the > specification. >Index: mtree.c >=================================================================== >RCS file: /usr/cvs/src/usr.sbin/mtree/mtree.c,v >retrieving revision 1.8.2.1 >diff -u -r1.8.2.1 mtree.c >--- mtree.c 2000/05/15 20:49:59 1.8.2.1 >+++ mtree.c 2000/10/02 16:59:18 >@@ -57,8 +57,9 @@ > > extern long int crc_total; > >-int ftsoptions = FTS_LOGICAL; >+int ftsoptions = 0; > int cflag, dflag, eflag, iflag, nflag, rflag, sflag, uflag, Uflag; >+int Lflag, Pflag; > u_int keys; > char fullpath[MAXPATHLEN]; > >@@ -77,7 +78,7 @@ > keys = KEYDEFAULT; > init_excludes(); > >- while ((ch = getopt(argc, argv, "cdef:iK:k:np:rs:UuxX:")) != -1) >+ while ((ch = getopt(argc, argv, "cdef:iK:k:Lnp:Prs:UuxX:")) != -1) > switch((char)ch) { > case 'c': > cflag = 1; >@@ -106,12 +107,22 @@ > if (*p != '\0') > keys |= parsekey(p, NULL); > break; >+ case 'L': >+ if (Pflag) >+ usage(); >+ Lflag = 1; >+ break; > case 'n': > nflag = 1; > break; > case 'p': > dir = optarg; > break; >+ case 'P': >+ if (Lflag) >+ usage(); >+ Pflag = 1; >+ break; > case 'r': > rflag = 1; > break; >@@ -143,6 +154,18 @@ > if (argc) > usage(); > >+ if (Lflag + Pflag > 1) >+ usage(); >+ >+ if (Lflag + Pflag == 0) >+ Lflag = 1; /* -L (follow symlinks) default */ >+ >+ if (Lflag) >+ ftsoptions |= FTS_LOGICAL; >+ >+ if (Pflag) >+ ftsoptions |= FTS_PHYSICAL; >+ > if (dir && chdir(dir)) > err(1, "%s", dir); > >@@ -163,7 +186,7 @@ > usage() > { > (void)fprintf(stderr, >-"usage: mtree [-cdeinrUux] [-f spec] [-K key] [-k key] [-p path] [-s seed]\n" >+"usage: mtree [-cdeiLnPrUux] [-f spec] [-K key] [-k key] [-p path] [-s seed]\n" > "\t[-X excludes]\n"); > exit(1); > } >-- CUT HERE --
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 21725
: 10920