chiark / gitweb /
Introduce build_prep subroutine and use it where appropriate
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 25 Aug 2013 15:21:54 +0000 (16:21 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 25 Aug 2013 15:21:54 +0000 (16:21 +0100)
debian/changelog
dgit

index cdcf9ecdfa8942d01855fbc1a74ec01e8c8a4713..5d32b0c584e793c570f68ce9f8c5af1e7ecc99f0 100644 (file)
@@ -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 693aa18267d30ab931e6d4ce5c25ca6ff02ba7f2..1db2cdb0893108093911b78dcb460087ce89ee01 100755 (executable)
--- 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 {