+2007-05-23 Guillem Jover <guillem@debian.org>
+
+ * 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 <guillem@debian.org>
* scripts/dpkg-statoverride.pl ($pat): Rename to ...
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
&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");
}