Sfoglia il codice sorgente

dpkg-source: Make single-debian-patch not abort on upstream changes

The single-debian-patch option usage in Dpkg::Source::Package::V2
was typoed as single_debian_patch, and thus not avoiding aborting
on upstream changes. Instead of fixing the typo, let's just not
expose single-debian-patch in Dpkg::Source::Package::V2, as it's
Dpkg::Source::Package::V3::quilt specific and as such a layer
violation, the code will just set auto_commit when single-debian-patch
is specified, which is the actual intended behaviour. Reflect this
explicitly in the man page.

Regression introduced in commit 46b688e4824f00842568b517b119eec34a5f7286.

Reported-by: Bernhard R. Link <brlink@debian.org>
Guillem Jover 15 anni fa
parent
commit
f3418186f6

+ 1 - 1
man/dpkg-source.1

@@ -445,7 +445,7 @@ or \fBdebian\-changes\fP, depending on \fB\-\-single\-debian\-patch\fP) are
 applied. The temporary directory is compared to the source package
 directory. When the diff is non-empty, the build fails unless
 \fB\-\-single\-debian\-patch\fP or \fB\-\-auto\-commit\fP
-has been used. In the latter case, the diff is stored in the automatic patch.
+has been used, in which case the diff is stored in the automatic patch.
 If the automatic patch is created/deleted, it's added/removed from the
 series file and from the quilt metadata.
 

+ 1 - 2
scripts/Dpkg/Source/Package/V2.pm

@@ -501,8 +501,7 @@ sub do_build {
     my $tmpdiff = $self->generate_patch($dir, order_from => $autopatch,
                                         handle_binary => $handle_binary,
                                         usage => 'build');
-    unless (-z $tmpdiff or $self->{'options'}{'single_debian_patch'}
-            or $self->{'options'}{'auto_commit'}) {
+    unless (-z $tmpdiff or $self->{'options'}{'auto_commit'}) {
         info(_g("you can integrate the local changes with %s"),
              "dpkg-source --commit");
         error(_g("aborting due to unexpected upstream changes, see %s"),

+ 2 - 0
scripts/Dpkg/Source/Package/V3/quilt.pm

@@ -54,6 +54,8 @@ sub parse_cmdline_option {
     return 1 if $self->SUPER::parse_cmdline_option($opt);
     if ($opt =~ /^--single-debian-patch$/) {
         $self->{'options'}{'single-debian-patch'} = 1;
+        # For backwards compatibility.
+        $self->{'options'}{'auto_commit'} = 1;
         return 1;
     } elsif ($opt =~ /^--allow-version-of-quilt-db=(.*)$/) {
         push @{$self->{'options'}{'allow-version-of-quilt-db'}}, $1;