Date: Wed, 31 May 2006 21:30:20 GMT From: Graham J Lee <leeg@teaching.physics.ox.ac.uk> To: freebsd-bugs@FreeBSD.org Subject: Re: bin/88056 Message-ID: <200605312130.k4VLUK7e081052@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/88056; it has been noted by GNATS. From: Graham J Lee <leeg@teaching.physics.ox.ac.uk> To: bug-followup@freebsd.org Cc: Subject: Re: bin/88056 Date: Wed, 31 May 2006 22:27:50 +0100 This is a multi-part message in MIME format. --------------030803070701060008010503 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit I've only tried this on Darwin/BSD but it appears to work...adds a '-x' flag which sets the FTS_XDEV option. Cheers, Graham. -- Graham Lee UNIX Systems Manager, Oxford Physics Practical Course http://users.ox.ac.uk/~wadh1342 --------------030803070701060008010503 Content-Type: text/plain; x-mac-type="0"; x-mac-creator="0"; name="cp.c.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="cp.c.patch" --- cp.c.orig 2006-05-31 22:15:03.000000000 +0100 +++ cp.c 2006-05-31 22:17:55.000000000 +0100 @@ -83,7 +83,7 @@ PATH_T to = { to.p_path, emptystring, "" }; -int fflag, iflag, nflag, pflag, vflag; +int fflag, iflag, nflag, pflag, vflag, xflag; static int Rflag, rflag; volatile sig_atomic_t info; @@ -101,8 +101,8 @@ int Hflag, Lflag, Pflag, ch, fts_options, r, have_trailing_slash; char *target; - Hflag = Lflag = Pflag = 0; - while ((ch = getopt(argc, argv, "HLPRfinprv")) != -1) + Hflag = Lflag = Pflag = xflag = 0; + while ((ch = getopt(argc, argv, "HLPRfinprvx")) != -1) switch (ch) { case 'H': Hflag = 1; @@ -140,6 +140,9 @@ case 'v': vflag = 1; break; + case 'x': + xflag = 1; + break; default: usage(); break; @@ -151,6 +154,9 @@ usage(); fts_options = FTS_NOCHDIR | FTS_PHYSICAL; + if (xflag) { + fts_options |= FTS_XDEV; + } if (rflag) { if (Rflag) errx(1, --------------030803070701060008010503 Content-Type: text/plain; x-mac-type="0"; x-mac-creator="0"; name="utils.c.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="utils.c.patch" --- utils.c.orig 2006-05-31 22:20:13.000000000 +0100 +++ utils.c 2006-05-31 22:21:46.000000000 +0100 @@ -411,8 +411,8 @@ { (void)fprintf(stderr, "%s\n%s\n", -"usage: cp [-R [-H | -L | -P]] [-f | -i | -n] [-pv] source_file target_file", -" cp [-R [-H | -L | -P]] [-f | -i | -n] [-pv] source_file ... " +"usage: cp [-R [-H | -L | -P]] [-f | -i | -n] [-pvx] source_file target_file", +" cp [-R [-H | -L | -P]] [-f | -i | -n] [-pvx] source_file ... " "target_directory"); exit(EX_USAGE); } --------------030803070701060008010503--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200605312130.k4VLUK7e081052>
