The following commit has been merged in the sid branch:
commit 669e0ff496e6870c06de82da111ba069263a0456
Author: Raphaël Hertzog <[email protected]>
Date:   Tue Sep 27 08:44:12 2011 +0200

    dpkg-source: do not ignore the automatic patch when checking for unrecorded 
changes
    
    The former behaviour to always generate the automatic patch required to
    not apply it on the tree used as a basis for the patch generation. That
    way it could be updated at each build.
    
    With the new behaviour to fail on any new change, we should no longer
    ignore it. It must be applied on the reference tree except when
    --auto-commit is on.
    
    This should fix 227 (source package) build failures in Debian unstable.

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 <[email protected]>  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..f93ff3f 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,12 +512,14 @@ 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;
-    rmdir(File::Spec->catdir($dir, "debian", "patches")); # No check on purpose
+    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;
 

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to