From: Guillem Jover Date: Tue, 22 May 2007 22:39:39 +0000 (+0000) Subject: Fix perl warnings: X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=256eda4fcf3e247ed35ad52d1531da9e0d2c57d7;p=dpkg Fix perl warnings: - When unpacking a source package with -sp from a different directory than the one containing the tarball. Closes: #424998 --- diff --git a/ChangeLog b/ChangeLog index ad80e52e..44fb3326 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-05-23 Guillem Jover + + * scripts/dpkg-source.pl ($copy_required): New variable. + ($dumptardev, $dumptarino): Move declaration inside the block issues + the stat call, and only compare them against $dsctardev and $dsctarino + if the stat succeeded. + 2007-05-21 Guillem Jover * scripts/dpkg-statoverride.pl ($pat): Rename to ... diff --git a/debian/changelog b/debian/changelog index c8554639..dcfb001c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,9 @@ dpkg (1.14.4) UNRELEASED; urgency=low [ Guillem Jover ] + * Fix perl warnings: + - When unpacking a source package with -sp from a different directory + than the one containing the tarball. Closes: #424998 * Remove an unused variable in dpkg-statoverride by renaming it to the initially intended name. Closes: #425041 diff --git a/scripts/dpkg-source.pl b/scripts/dpkg-source.pl index 0d36f52b..a91dc869 100755 --- a/scripts/dpkg-source.pl +++ b/scripts/dpkg-source.pl @@ -835,15 +835,20 @@ if ($opmode eq 'build') { &syserr(sprintf(_g("failed to stat `%s' to see if need to copy"), "$dscdir/$tarfile")); my ($dsctardev, $dsctarino) = stat _; - my ($dumptardev, $dumptarino); + my $copy_required; - if (!stat($tarfile)) { - $! == ENOENT || &syserr(sprintf(_g("failed to check destination `%s'". - " to see if need to copy"), $tarfile)); + if (stat($tarfile)) { + my ($dumptardev, $dumptarino) = stat _; + $copy_required = ($dumptardev != $dsctardev || + $dumptarino != $dsctarino); } else { - ($dumptardev,$dumptarino) = stat _; + $! == ENOENT || + syserr(sprintf(_g("failed to check destination `%s'". + " to see if need to copy"), $tarfile)); + $copy_required = 1; } - unless ($dumptardev == $dsctardev && $dumptarino == $dsctarino) { + + if ($copy_required) { system('cp','--',"$dscdir/$tarfile", $tarfile); $? && subprocerr("cp $dscdir/$tarfile to $tarfile"); }