Jonathan Nieder wrote:
> Stéphane Glondu wrote:
>> And it seems that the bug doesn't appear on all filesystems (I was using
>> NFS [and ext4 on the server side] when it bit me). If you have a better
>> explanation/fix, I will be glad to hear it.
>
> Not sure. Maybe a problem of timestamp granularity? (Some file being
> changed at t=487324789324532.5 and then dpkg-source resetting another
> timestamp to 487324789324532.0.)
Ah, I figured it out. You have about 15 seconds of time skew between
the NFS server and client. So:
1. Please, install ntpdate or similar on both machines. :)
2. Raphaël, maybe dpkg-source could do something like this?
utime does not return ENOENT unless all its arguments do not
exist.
diff --git a/scripts/Dpkg/Source/Patch.pm b/scripts/Dpkg/Source/Patch.pm
index 59d1004..ef3b690 100644
--- a/scripts/Dpkg/Source/Patch.pm
+++ b/scripts/Dpkg/Source/Patch.pm
@@ -500,13 +500,14 @@ sub apply {
}
$self->close();
# Reset the timestamp of all the patched files
- # and remove .dpkg-orig files
- my $now = $opts{"timestamp"} || time;
+ my $now = $opts{"timestamp"} || undef;
+ if ($opts{"force_timestamp"}) {
+ utime($now, $now, keys %{$analysis->{'filepatched'}}) ||
+ $! == ENOENT ||
+ syserr(_g("cannot change timestamp of patched file"));
+ }
+ # Remove .dpkg-orig files
foreach my $fn (keys %{$analysis->{'filepatched'}}) {
- if ($opts{"force_timestamp"}) {
- utime($now, $now, $fn) || $! == ENOENT ||
- syserr(_g("cannot change timestamp for %s"), $fn);
- }
if ($opts{"remove_backup"}) {
$fn .= ".dpkg-orig";
unlink($fn) || syserr(_g("remove patch backup file %s"), $fn);
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]