diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2013-08-25 16:21:54 +0100 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2013-08-25 16:21:54 +0100 |
commit | 69c5b89e545bb8276b1bb20f399b8df75607d868 (patch) | |
tree | dd906089caa17d6ba29b835a4e635e6d35e28697 /dgit | |
parent | 137c52ea5d2df0b07c30420697297032842407f4 (diff) |
Introduce build_prep subroutine and use it where appropriate
Diffstat (limited to 'dgit')
-rwxr-xr-x | dgit | 20 |
1 files changed, 9 insertions, 11 deletions
@@ -1052,15 +1052,19 @@ sub quilt_fixup_editor () { exit 0; } -sub cmd_build { - # we pass further options and args to git-buildpackage - badusage "-p is not allowed with dgit build" if defined $package; - badusage "dgit build implies --clean=dpkg-source" if defined $package; +sub build_prep () { + badusage "-p is not allowed when building" if defined $package; + check_not_dirty(); my $clogp = parsechangelog(); $isuite = getfield $clogp, 'Distribution'; $package = getfield $clogp, 'Source'; $version = getfield $clogp, 'Version'; build_maybe_quilt_fixup(); +} + +sub cmd_build { + badusage "dgit build implies --clean=dpkg-source" if defined $package; + build_prep(); my @cmd = (qw(git-buildpackage -us -uc --git-no-sign-tags), "--git-builder=@dpkgbuildpackage"); @@ -1074,15 +1078,9 @@ sub cmd_build { } sub build_source { - badusage "-p is not allowed with this action" if defined $package; - check_not_dirty(); - my $clogp = parsechangelog(); - $package = getfield $clogp, 'Source'; - $isuite = getfield $clogp, 'Distribution'; - $version = getfield $clogp, 'Version'; + build_prep(); $sourcechanges = "${package}_${version}_source.changes"; $dscfn = dscfn($version); - build_maybe_quilt_fixup(); if ($cleanmode eq 'dpkg-source') { runcmd_ordryrun (@dpkgbuildpackage, qw(-us -uc -S)), changesopts(); } else { |