Selaa lähdekoodia

don't rename a file to itself

Wichert Akkerman 26 vuotta sitten
vanhempi
commit
ca0f4a90bf
3 muutettua tiedostoa jossa 12 lisäystä ja 4 poistoa
  1. 5 0
      ChangeLog
  2. 2 1
      debian/changelog
  3. 5 3
      scripts/dpkg-source.pl

+ 5 - 0
ChangeLog

@@ -1,3 +1,8 @@
+Wed Oct 18 17:48:15 CEST 2000 Wichert Akkerman <wakkerma@debian.org>
+
+  * scripts/dpkg-source.pl: patch from Colin Watson to not rename a
+    file to itself
+
 Mon Oct 16 10:45:47 EDT 2000 Ben Collins <bcollins@debian.org>
 
   * main/packages.c: Hack up things so a package which

+ 2 - 1
debian/changelog

@@ -29,8 +29,9 @@ dpkg (1.7.0) unstable; urgency=low
   * Document -k option for dpkg-buildpackage. Closes: Bug#71808
   * Install dummy shlibs.default and shlibs.override files
   * Give dpkg a configurationfile
-  * dpkg-scanpackages now uses the most recent version if muiltiple versions
+  * dpkg-scanpackages now uses the most recent version if multiple versions
     of a package are found.
+  * don't rename a file to itself in dpkg-source. Closes: Bug#75060
 
  -- Wichert Akkerman <wakkerma@debian.org>  UNRELEASED
 

+ 5 - 3
scripts/dpkg-source.pl

@@ -945,9 +945,11 @@ sub extracttar {
     @dirchdirfiles = grep($_ ne "." && $_ ne "..",readdir(D));
     closedir(D) || &syserr("Unable to close dir $dirchdir");
     if (@dirchdirfiles==1 && -d "$dirchdir/$dirchdirfiles[0]") {
-	rename("$dirchdir/$dirchdirfiles[0]", "$dirchdir/$newtopdir") ||
-	    &syserr("Unable to rename $dirchdir/$dirchdirfiles[0] to ".
-	    "$dirchdir/$newtopdir");
+	if ("$dirchdir/$dirchdirfiles[0]" ne "$dirchdir/$newtopdir") {
+	    rename("$dirchdir/$dirchdirfiles[0]", "$dirchdir/$newtopdir") ||
+		&syserr("Unable to rename $dirchdir/$dirchdirfiles[0] to ".
+		"$dirchdir/$newtopdir");
+	}
     } else {
 	mkdir("$dirchdir/$newtopdir", 0777) ||
 	    &syserr("Unable to mkdir $dirchdir/$newtopdir");