[devscripts] 07/14: Perls move() function is unreliable when moving directories so we need to check in advance and prevent using move() when the source is a directory

James McCoy jamessan at debian.org
Thu Nov 21 03:53:46 UTC 2013


This is an automated email from the git hooks/post-receive script.

jamessan pushed a commit to branch master
in repository devscripts.

commit 392e777400b9adf0165c52400bb2bf0ea8263ba1
Author: Andreas Tille <tille at debian.org>
Date:   Sun Aug 26 23:13:29 2012 +0200

    Perls move() function is unreliable when moving directories so we need to check in advance and prevent using move() when the source is a directory
---
 scripts/uscan.pl |   14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/scripts/uscan.pl b/scripts/uscan.pl
index 2562712..d80baaa 100755
--- a/scripts/uscan.pl
+++ b/scripts/uscan.pl
@@ -2170,13 +2170,13 @@ sub get_main_source_dir($$$$) {
     mkdir($main_source_dir) or uscan_die("Unable to create temporary source directory $main_source_dir\n");
     foreach my $file (@files) {
 	unless ($file =~ /^\.\.?/) {
-	    # move("${tempdir}/$file", $main_source_dir) or die("Unable to move ${tempdir}/$file directory $main_source_dir\n");
-	    unless (move("${tempdir}/$file", $main_source_dir)) {
-		# HELP: why can't perl move not move directories????
-		print "Perl move seems to be not able to ` move(\"${tempdir}/$file\", $main_source_dir) ` ... trying system mv\n" if $debug;
-		system('mv', "${tempdir}/$file", $main_source_dir);
-	    }
-	}
+	    if ( -d "${tempdir}/$file" ) {
+                # HELP: why can't perl move not move directories????
+                system( "mv ${tempdir}/$file $main_source_dir" ) ;
+            } else {
+                move("${tempdir}/$file", $main_source_dir) or die("Unable to move ${tempdir}/$file directory $main_source_dir\n");
+            }
+        }
     }
     return $main_source_dir;
 }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/collab-maint/devscripts.git



More information about the devscripts-devel mailing list