From 4fa125c3dc9f093864d5e327eb339c431a93a5f2 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 6 Jul 2019 12:14:18 +0100 Subject: [PATCH] dgit: Allow -p with various push modes This checks the supplied package name against the changelog. Signed-off-by: Ian Jackson --- dgit | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/dgit b/dgit index 6febb07a..1fa1f529 100755 --- a/dgit +++ b/dgit @@ -6575,12 +6575,15 @@ sub WANTSRC_BUILDER () { 02; } # caller should run dpkg-buildpackage sub build_or_push_prep_early () { our $build_or_push_prep_early_done //= 0; return if $build_or_push_prep_early_done++; - badusage f_ "-p is not allowed with dgit %s", $subcommand - if defined $package; my $clogp = parsechangelog(); $isuite = getfield $clogp, 'Distribution'; - $package = getfield $clogp, 'Source'; + my $gotpackage = getfield $clogp, 'Source'; $version = getfield $clogp, 'Version'; + $package //= $gotpackage; + if ($package ne $gotpackage) { + fail f_ "-p specified package %s, but changelog says %s", + $package, $gotpackage; + } $dscfn = dscfn($version); } -- 2.30.2