From: Ian Jackson Date: Sun, 25 Aug 2013 15:21:54 +0000 (+0100) Subject: Introduce build_prep subroutine and use it where appropriate X-Git-Tag: debian/0.11~5 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=commitdiff_plain;h=69c5b89e545bb8276b1bb20f399b8df75607d868;ds=sidebyside Introduce build_prep subroutine and use it where appropriate --- diff --git a/debian/changelog b/debian/changelog index cdcf9ecd..5d32b0c5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -14,6 +14,8 @@ dgit (0.11) unstable; urgency=low * Better error message for use of UNRELEASED suite. Closes: #720523. * Do not canonicalise suite more than once. Related to: #720526. * Fix a badly open-coded copy of check_not_dirty. Closes: #720524. + * Fix some bugs in building (eg build-source would fail to do the quilt + fixup). -- diff --git a/dgit b/dgit index 693aa182..1db2cdb0 100755 --- a/dgit +++ b/dgit @@ -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 {