Author: guillem
Date: 2007-05-22 22:39:39 +0000 (Tue, 22 May 2007)
New Revision: 787
Modified:
trunk/ChangeLog
trunk/debian/changelog
trunk/scripts/dpkg-source.pl
Log:
Fix perl warnings:
- When unpacking a source package with -sp from a different directory
than the one containing the tarball. Closes: #424998
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2007-05-22 22:36:42 UTC (rev 786)
+++ trunk/ChangeLog 2007-05-22 22:39:39 UTC (rev 787)
@@ -1,3 +1,10 @@
+2007-05-23 Guillem Jover <[EMAIL PROTECTED]>
+
+ * 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 <[EMAIL PROTECTED]>
* scripts/dpkg-statoverride.pl ($pat): Rename to ...
Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog 2007-05-22 22:36:42 UTC (rev 786)
+++ trunk/debian/changelog 2007-05-22 22:39:39 UTC (rev 787)
@@ -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
Modified: trunk/scripts/dpkg-source.pl
===================================================================
--- trunk/scripts/dpkg-source.pl 2007-05-22 22:36:42 UTC (rev 786)
+++ trunk/scripts/dpkg-source.pl 2007-05-22 22:39:39 UTC (rev 787)
@@ -835,15 +835,20 @@
&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");
}
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]