summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2016-10-25 16:58:12 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2016-10-25 16:58:12 +0100
commit87e81c248ac9d7966be07dc556035f3d395f5fcb (patch)
treee790ec4fe1581d1437e82b62b0580e5f32a2c6b9
parent50419637c2d62d5368a52b6ddb3011f6a75b3b0d (diff)
build changes handling: Break out midbuild_checkchanges
No functional change. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
-rwxr-xr-xdgit23
1 files changed, 13 insertions, 10 deletions
diff --git a/dgit b/dgit
index d6a6326..911ad4e 100755
--- 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): $!";