From: Wichert Akkerman Date: Wed, 18 Oct 2000 15:49:40 +0000 (+0000) Subject: don't rename a file to itself X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ca0f4a90bff35f59241342ba7c3754a43e8c5a11;p=dpkg don't rename a file to itself --- diff --git a/ChangeLog b/ChangeLog index a351579f..0cfc6f6a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Wed Oct 18 17:48:15 CEST 2000 Wichert Akkerman + + * 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 * main/packages.c: Hack up things so a package which diff --git a/debian/changelog b/debian/changelog index 41dd2ef9..5f18967b 100644 --- a/debian/changelog +++ b/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 UNRELEASED diff --git a/scripts/dpkg-source.pl b/scripts/dpkg-source.pl index d403b3b2..5cd4766c 100755 --- a/scripts/dpkg-source.pl +++ b/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");