The long options were added in dpkg 1.18.8, where the --help output
documented this one as --sign-pause, while the parser was written as
--sign-pausa.  The documented spelling has therefore never been
accepted, and the accepted spelling has never been documented, neither
in --help nor in the man page.

Correct the parser to use the documented and intended spelling.  Do not
keep the misspelling as a deprecated alias, as it was never part of the
documented interface, and the short -ap option has always worked; it now
gets the usual unknown option error, which names the offending option.

Document the option in the man page, which has been missing an entry for
it all along.
---
 man/dpkg-buildpackage.pod     |  7 +++++++
 scripts/dpkg-buildpackage.pl  |  2 +-
 scripts/t/dpkg_buildpackage.t | 17 ++++++++++++++++-
 3 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/man/dpkg-buildpackage.pod b/man/dpkg-buildpackage.pod
index cd49ba2d0..89eb110a8 100644
--- a/man/dpkg-buildpackage.pod
+++ b/man/dpkg-buildpackage.pod
@@ -731,6 +731,13 @@ password.
 
 Supported since dpkg 1.21.10.
 
+=item B<-ap>, B<--sign-pause>
+
+Wait for the user to press B<Enter> before starting the signing process.
+This only has an effect if at least one file is going to be signed.
+
+Support for long option since dpkg 1.23.12.
+
 =item B<-us>, B<--unsigned-source>
 
 Do not sign the source package.
diff --git a/scripts/dpkg-buildpackage.pl b/scripts/dpkg-buildpackage.pl
index f057a64cf..3e41911d9 100755
--- a/scripts/dpkg-buildpackage.pl
+++ b/scripts/dpkg-buildpackage.pl
@@ -545,7 +545,7 @@ while (@ARGV) {
     } elsif (/^-uc$/ or /^--unsigned-changes$/) {
         $signbuildinfo = 0;
         $signchanges = 0;
-    } elsif (/^-ap$/ or /^--sign-pausa$/) {
+    } elsif (/^-ap$/ or /^--sign-pause$/) {
         $signpause = 1;
     } elsif (/^-a$/ or /^--host-arch$/) {
         $host_arch = shift;
diff --git a/scripts/t/dpkg_buildpackage.t b/scripts/t/dpkg_buildpackage.t
index cbfe03b78..405388831 100644
--- a/scripts/t/dpkg_buildpackage.t
+++ b/scripts/t/dpkg_buildpackage.t
@@ -29,7 +29,7 @@ use Dpkg::BuildTypes;
 use Dpkg::Substvars;
 
 test_needs_command('fakeroot');
-plan tests => 17;
+plan tests => 18;
 
 my $srcdir = rel2abs($ENV{srcdir} || '.');
 my $datadir = "$srcdir/t/dpkg_buildpackage";
@@ -52,6 +52,21 @@ $ENV{PATH} = "$srcdir/t/mock-bin:$ENV{PATH}";
 
 chdir $tmpdir;
 
+my $stderr;
+
+spawn(
+    exec => [
+        $ENV{PERL}, "$srcdir/dpkg-buildpackage.pl",
+        '--sign-pause', '--help',
+    ],
+    to_file => '/dev/null',
+    error_to_string => \$stderr,
+    wait_child => 1,
+    no_check => 1,
+);
+ok($? == 0 && $stderr eq '', '--sign-pause is accepted');
+diag($stderr) unless $? == 0;
+
 my $tmpl_format = <<'TMPL_FORMAT';
 3.0 (native)
 TMPL_FORMAT
-- 
2.47.3

Reply via email to