summaryrefslogtreecommitdiff
path: root/dgit
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2019-07-06 12:14:18 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2019-07-06 15:57:24 +0100
commit4fa125c3dc9f093864d5e327eb339c431a93a5f2 (patch)
tree6a35ed7d980430ba8826d7cde6e282291cce2c78 /dgit
parent08b7893fc9ce813587108a7172f9143e87c07c9a (diff)
dgit: Allow -p with various push modes
This checks the supplied package name against the changelog. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'dgit')
-rwxr-xr-xdgit9
1 files changed, 6 insertions, 3 deletions
diff --git a/dgit b/dgit
index 6febb07..1fa1f52 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);
}