瀏覽代碼

Use find with -L instead of deprecated -follow

Guillem Jover 16 年之前
父節點
當前提交
0814d1b1eb

+ 3 - 2
dselect/methods/disk/install

@@ -70,8 +70,9 @@ do
 				defined($c= open(X,"-|")) ||
 					die "failed to fork for find: $!\n";
 				if (!$c) {
-					exec("find", length($binaryprefix)
-					     ? $binaryprefix : ".","-follow",
+					exec("find", "-L",
+					     length($binaryprefix) ?
+					     $binaryprefix : ".",
 					     "-name",$base,"-o","-name",$msdosbase);
 					die "failed to exec find: $!\n";
 				}

+ 1 - 1
dselect/methods/disk/setup

@@ -428,7 +428,7 @@ check_binary () {
 		return
 	fi
 
-	if ! ( find "$mountpoint$2/" -follow -name '*.deb' -print \
+	if ! ( find -L "$mountpoint$2/" -name '*.deb' -print \
 	        | head -n 1 ) 2>/dev/null  | grep . >/dev/null
 	then
 		echo "\`$2' does not contain any *.deb packages.  Hmmpf."

+ 2 - 2
dselect/methods/multicd/install

@@ -151,8 +151,8 @@ Please change the discs and press <RETURN>.
 				defined($c= open(X,"-|")) ||
 					die "failed to fork for find: $!\n";
 				if (!$c) {
-					exec("find", length($binaryprefix)
-					     ? $binaryprefix : ".","-follow",
+					exec("find", "-L",
+					     length($binaryprefix) ? $binaryprefix : ".",
 					     "-name",$base,"-o","-name",$msdosbase);
 					die "failed to exec find: $!\n";
 				}

+ 1 - 1
dselect/methods/multicd/setup

@@ -508,7 +508,7 @@ check_binary () {
 # .deb files.  Each CD should contain all Packages.cd files but doesn't
 # need to contain the .deb files.
 #
-#  	if ! { find "$mountpoint$2" -follow -name '*.deb' -print \
+#  	if ! { find -L "$mountpoint$2" -name '*.deb' -print \
 #  		| head -1 | grep . ; } >/dev/null 2>&1 && [ -z "$multi" ];
 #  	then
 #  		echo "\`$2' does not contain any *.deb packages."

+ 1 - 2
scripts/dpkg-scanpackages.pl

@@ -158,7 +158,6 @@ if ($options{arch}) {
 else {
      @find_args = ('-name', "*.$type");
 }
-push @find_args, '-follow';
 
 my ($binarydir, $override, $pathprefix) = @ARGV;
 
@@ -169,7 +168,7 @@ defined($override) and (-e $override or
 $pathprefix = '' if not defined $pathprefix;
 
 my $find_h = new IO::Handle;
-open($find_h,'-|','find',"$binarydir/",@find_args,'-print')
+open($find_h, '-|', 'find', '-L', "$binarydir/", @find_args, '-print')
      or syserr(_g("Couldn't open %s for reading"), $binarydir);
 FILE:
     while (<$find_h>) {

+ 1 - 1
scripts/dpkg-scansources.pl

@@ -354,7 +354,7 @@ sub main {
     load_src_override $Src_override, $override;
     load_extra_override $Extra_override_file if defined $Extra_override_file;
 
-    open FIND, "find \Q$dir\E -follow -name '*.dsc' -print |"
+    open FIND, "find -L \Q$dir\E -name '*.dsc' -print |"
         or syserr(_g("cannot fork for %s"), "find");
     while (<FIND>) {
     	chomp;

+ 2 - 2
src/archives.c

@@ -1082,7 +1082,8 @@ void archivefiles(const char *const *argv) {
       for (i=0, ap=argv; *ap; ap++, i++);
       arglist = m_malloc(sizeof(char *) * (i + 15));
       arglist[0] = FIND;
-      for (i=1, ap=argv; *ap; ap++, i++) {
+      arglist[1] = "-L";
+      for (i = 2, ap = argv; *ap; ap++, i++) {
         if (strchr(FIND_EXPRSTARTCHARS,(*ap)[0])) {
           char *a;
           a= m_malloc(strlen(*ap)+10);
@@ -1096,7 +1097,6 @@ void archivefiles(const char *const *argv) {
       /* When editing these, make sure that arglist is malloced big enough,
        * above.
        */
-      arglist[i++] = "-follow";
       arglist[i++] = "-name";
       arglist[i++] = ARCHIVE_FILENAME_PATTERN;
       arglist[i++] = "-type";