From: Ian Jackson Date: Sat, 6 Jul 2019 11:14:18 +0000 (+0100) Subject: dgit: Allow -p with various push modes X-Git-Tag: archive/debian/9.1~84 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=4fa125c3dc9f093864d5e327eb339c431a93a5f2;p=dgit.git dgit: Allow -p with various push modes This checks the supplied package name against the changelog. Signed-off-by: Ian Jackson --- 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); }