chiark / gitweb /
build changes handling: Break out midbuild_checkchanges
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 25 Oct 2016 15:58:12 +0000 (16:58 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 25 Oct 2016 15:58:12 +0000 (16:58 +0100)
No functional change.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
dgit

diff --git a/dgit b/dgit
index d6a6326..911ad4e 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -4938,6 +4938,18 @@ END
     printdone "build successful, results in $result\n" or die $!;
 }
 
+sub midbuild_checkchanges () {
+    my $pat = changespat $version;
+    return if $rmchanges;
+    my @unwanted = map { s#^\.\./##; $_; } glob "../$pat";
+    @unwanted = grep { $_ ne changespat $version,'source' } @unwanted;
+    fail <<END
+changes files other than source matching $pat already present; building would result in ambiguity about the intended results.
+Suggest you delete @unwanted.
+END
+       if @unwanted;
+}
+
 sub postbuild_mergechanges_vanilla ($) {
     my ($wantsrc) = @_;
     if ($wantsrc == 1) {
@@ -5072,16 +5084,7 @@ sub cmd_build_source {
 
 sub cmd_sbuild {
     build_source();
-    my $pat = changespat $version;
-    if (!$rmchanges) {
-       my @unwanted = map { s#^\.\./##; $_; } glob "../$pat";
-       @unwanted = grep { $_ ne changespat $version,'source' } @unwanted;
-       fail <<END
-changes files other than source matching $pat already present; building would result in ambiguity about the intended results.
-Suggest you delete @unwanted.
-END
-           if @unwanted;
-    }
+    midbuild_checkchanges();
     in_parent {
        if (act_local()) {
            stat_exists $dscfn or fail "$dscfn (in parent directory): $!";