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

Re: bsdgames: FTBFS: dpkg-buildpackage: error: dpkg-source -b bsdgames-2.17 gave error exit status 2



Hi Jonathan,

On Mon, 26 Sep 2011, Jonathan Nieder wrote:
> That means that debian/patches/debian-changes-2.17-19 is ignored,
> causing a build failure.  I would have expected the patch to be
> included because it already exists in the source package that was
> extracted.  Its nondescriptive debian-changes-* name is water under
> the bridge.
> 
> In other words, it seems like 1.16.1~143 (dpkg-source: implement
> --commit and fail with unrecorded changes, 2011-07-14) is making
> some existing packages no longer pass the following test:
> 
> 	dpkg-source -x <package>.dsc
> 	cd <package>-<version>
> 	dpkg-buildpackage -S
> 
> Is that intended?  If not, any ideas for fixing it?

It's not really intended but it's logical. Those changes are clearly
associated with the current Debian release and have not been properly
integrated in a dedicated quilt patch.

Attached is a suggested patch though. Now that we don't auto-update
the automatic patch by default, it doesn't make sense to act as if we're
going to regenerate it.

The only case where we want to regenerate it is when we have
--auto-commit.

I would still suggest to not merge all the 227 bugs against dpkg but to
switch them to minor with a title like "unexpected and undocumented changes
in debian/patches/debian-changes-<ver>".

Cheers,
-- 
Raphaël Hertzog ◈ Debian Developer

Follow my Debian News ▶ http://RaphaelHertzog.com (English)
                      ▶ http://RaphaelHertzog.fr (Français)
diff --git a/debian/changelog b/debian/changelog
index 00a6515..6d6a672 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+dpkg (1.16.1.1) UNRELEASED; urgency=low
+
+  * Fix dpkg-source to not ignore the automatic patch when checking
+    for unrecorded changes.
+
+ -- Raphaël Hertzog <hertzog@debian.org>  Tue, 27 Sep 2011 08:15:51 +0200
+
 dpkg (1.16.1) unstable; urgency=low
 
   [ Raphaël Hertzog ]
diff --git a/scripts/Dpkg/Source/Package/V2.pm b/scripts/Dpkg/Source/Package/V2.pm
index 53a6699..ceaf0a8 100644
--- a/scripts/Dpkg/Source/Package/V2.pm
+++ b/scripts/Dpkg/Source/Package/V2.pm
@@ -369,7 +369,8 @@ sub generate_patch {
     subprocerr(_g("copy of the debian directory")) if $?;
 
     # Apply all patches except the last automatic one
-    $self->apply_patches($tmp, skip_auto => 1, usage => 'build');
+    $opts{'skip_auto'} //= 0;
+    $self->apply_patches($tmp, skip_auto => $opts{'skip_auto'}, usage => 'build');
 
     # Create a patch
     my ($difffh, $tmpdiff) = tempfile($self->get_basename(1) . ".diff.XXXXXX",
@@ -500,6 +501,7 @@ sub do_build {
                                         $self->get_autopatch_name());
     my $tmpdiff = $self->generate_patch($dir, order_from => $autopatch,
                                         handle_binary => $handle_binary,
+                                        skip_auto => $self->{'options'}{'auto_commit'},
                                         usage => 'build');
     unless (-z $tmpdiff or $self->{'options'}{'auto_commit'}) {
         info(_g("you can integrate the local changes with %s"),
@@ -510,11 +512,13 @@ sub do_build {
     push @Dpkg::Exit::handlers, sub { unlink($tmpdiff) };
 
     # Install the diff as the new autopatch
-    mkpath(File::Spec->catdir($dir, "debian", "patches"));
-    $autopatch = $self->register_patch($dir, $tmpdiff,
-                                       $self->get_autopatch_name());
-    info(_g("local changes have been recorded in a new patch: %s"), $autopatch)
-        if -e $autopatch;
+    if ($self->{'options'}{'auto_commit'}) {
+        mkpath(File::Spec->catdir($dir, "debian", "patches"));
+        $autopatch = $self->register_patch($dir, $tmpdiff,
+                                           $self->get_autopatch_name());
+        info(_g("local changes have been recorded in a new patch: %s"),
+             $autopatch) if -e $autopatch;
+    }
     rmdir(File::Spec->catdir($dir, "debian", "patches")); # No check on purpose
     unlink($tmpdiff) || syserr(_g("cannot remove %s"), $tmpdiff);
     pop @Dpkg::Exit::handlers;
@@ -625,7 +629,7 @@ sub commit {
     $self->prepare_build($dir);
 
     unless ($tmpdiff && -e $tmpdiff) {
-        $tmpdiff = $self->generate_patch($dir, usage => "commit");
+        $tmpdiff = $self->generate_patch($dir, skip_auto => 0, usage => "commit");
     }
     push @Dpkg::Exit::handlers, sub { unlink($tmpdiff) };
     unless (-s $tmpdiff) {

Reply to: