chiark / gitweb /
dgit: Disregard *_multi.changes for .changes ambiguity purposes
[dgit.git] / dgit
diff --git a/dgit b/dgit
index 63ef08231ff86ca6599f707f80d555b59eda107c..274f73aa9cc00cb7594f43f4f5f988cda5bca40d 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -4758,6 +4758,8 @@ sub cmd_push {
 
 sub cmd_push_source {
     prep_push();
+    fail "dgit push-source: --include-dirty/--ignore-dirty does not make".
+      "sense with push-source!" if $includedirty;
     if ($changesfile) {
         my $changes = parsecontrol("$buildproductsdir/$changesfile",
                                    "source changes file");
@@ -5652,7 +5654,8 @@ sub unpack_playtree_linkorigs ($$) {
     my ($upstreamversion, $fn) = @_;
     # calls $fn->($leafname);
 
-    opendir QFD, bpd_abs();
+    my $bpd_abs = bpd_abs();
+    opendir QFD, $bpd_abs or fail "buildproductsdir: $bpd_abs: $!";
     while ($!=0, defined(my $b = readdir QFD)) {
        my $f = bpd_abs()."/".$b;
        {
@@ -6246,7 +6249,7 @@ sub postbuild_mergechanges ($) {
     # or if that is undef, be a no-op.
     # Returns the changes file to report to the user.
     my $pat = changespat $version;
-    my @changesfiles = glob $pat;
+    my @changesfiles = grep { !m/_multi\.changes/ } glob $pat;
     @changesfiles = sort {
        ($b =~ m/_source\.changes$/ <=> $a =~ m/_source\.changes$/)
            or $a cmp $b
@@ -6283,7 +6286,10 @@ sub midbuild_checkchanges () {
     my $pat = changespat $version;
     return if $rmchanges;
     my @unwanted = map { s#.*/##; $_; } glob "$bpd_glob/$pat";
-    @unwanted = grep { $_ ne changespat $version,'source' } @unwanted;
+    @unwanted = grep {
+       $_ ne changespat $version,'source' and
+       $_ ne changespat $version,'multi'
+    } @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.
@@ -6863,7 +6869,7 @@ sub parseopts () {
            } elsif (m/^--(gbp|dpm)$/s) {
                push @ropts, "--quilt=$1";
                $quilt_mode = $1;
-           } elsif (m/^--ignore-dirty$/s) {
+           } elsif (m/^--(?:ignore|include)-dirty$/s) {
                push @ropts, $_;
                $includedirty = 1;
            } elsif (m/^--no-quilt-fixup$/s) {
@@ -7066,6 +7072,9 @@ sub parseopts_late_defaults () {
 
     $need_split_build_invocation ||= quiltmode_splitbrain();
 
+    fail "dgit: --include-dirty is not supported in split view quilt mode"
+       if $split_brain && $includedirty;
+
     if (!defined $cleanmode) {
        local $access_forpush;
        $cleanmode = access_cfg('clean-mode', 'RETURN-UNDEF');