[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: proper edit-build-install-test cycle with v3 source packages?



Hi,

On Thu, 22 Apr 2010, Niels Thykier wrote:
> Timo Juhani Lindfors wrote:
> > The above is not really usable with v3 source packages: apparently
> > dpkg-buildpackage modifies the timestamps of source files and emacs
> > complains that these files have changed on the disk. Should I just
> > modify emacs to ignore this warning?

No, there's no reason for those timestamps to be changed on build.

> Have you tried adding "-b" to dpkg-buildpackage as well? I think that
> should do it (unless the build/clean does weird things).

Using this option just avoids calling dpkg-source and works around what
looks like a bug. Why not report the bug instead?

Timo, I'd be glad if you could check whether the attached patch fixes the
issue for you. If yes, I'll commit it to dpkg.

Cheers,
-- 
Raphaël Hertzog

Like what I do? Sponsor me: http://ouaza.com/wp/2010/01/05/5-years-of-freexian/
My Debian goals: http://ouaza.com/wp/2010/01/09/debian-related-goals-for-2010/
diff --git a/scripts/Dpkg/Source/Package/V3/quilt.pm b/scripts/Dpkg/Source/Package/V3/quilt.pm
index 58c494b..ae4223e 100644
--- a/scripts/Dpkg/Source/Package/V3/quilt.pm
+++ b/scripts/Dpkg/Source/Package/V3/quilt.pm
@@ -163,12 +163,14 @@ sub apply_quilt_patch {
     my ($self, $dir, $patch, %opts) = @_;
     $opts{"verbose"} = 0 unless defined($opts{"verbose"});
     $opts{"timestamp"} = time() unless defined($opts{"timestamp"});
+    $opts{"force_timestamp"} = 1 unless defined($opts{"force_timestamp"});
+    $opts{"create_dirs"} = 1 unless defined($opts{"create_dirs"});
+    $opts{"remove_backup"} = 0 unless defined($opts{"remove_backup"});
     my $path = File::Spec->catfile($dir, "debian", "patches", $patch);
     my $obj = Dpkg::Source::Patch->new(filename => $path);
 
     info(_g("applying %s"), $patch) if $opts{"verbose"};
-    $obj->apply($dir, timestamp => $opts{"timestamp"},
-                force_timestamp => 1, create_dirs => 1, remove_backup => 0,
+    $obj->apply($dir, %opts,
                 options => [ '-s', '-t', '-F', '0', '-N', '-p1', '-u',
                              '-V', 'never', '-g0', '-E', '-b',
                              '-B', ".pc/$patch/" ]);
@@ -327,9 +329,10 @@ sub register_autopatch {
         # reverse-apply the patch, drop .pc/$patch, re-apply it
         # with the correct options to recreate the backup files
         my $patch_obj = Dpkg::Source::Patch->new(filename => $patch);
-        $patch_obj->apply($dir, add_options => ['-R', '-E']);
+        $patch_obj->apply($dir, add_options => ['-R', '-E'],
+                          force_timestamp => 0);
         erasedir(File::Spec->catdir($dir, ".pc", $auto_patch));
-        $self->apply_quilt_patch($dir, $auto_patch);
+        $self->apply_quilt_patch($dir, $auto_patch, force_timestamp => 0);
     } else {
         # Remove auto_patch from series
         if ($has_patch) {

Reply to: