chiark / gitweb /
dgit sbuild no longer deletes extranious .changes files; instead we rely on --rm...
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 7 Nov 2015 13:41:15 +0000 (13:41 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 1 Jul 2016 22:53:45 +0000 (23:53 +0100)
debian/changelog
dgit
dgit.1

index 331a316832cd73f8424c6f37f071244dd5851900..8d717fd556c9740540e35dbbf003fa3f42f0616d 100644 (file)
@@ -20,6 +20,8 @@ dgit (1.5~~) unstable; urgency=medium
     as a safety check.
   * No longer tolerate a multitude of .changes files when doing push.
     Instead, insist on a single one.
     as a safety check.
   * No longer tolerate a multitude of .changes files when doing push.
     Instead, insist on a single one.
+  * dgit sbuild no longer deletes extranious .changes files; instead
+    we rely on --rm-old-changes, or failing that, fail early.
 
   Documentation:
   * Document the dgit-distro.DISTRO.quilt-mode config setting.
 
   Documentation:
   * Document the dgit-distro.DISTRO.quilt-mode config setting.
diff --git a/dgit b/dgit
index e59060d240d2d3977a76d0319008f57c1f0f728b..15a0b0a6fc382a5fb3bb3f73fada0abfeacbd337 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -3149,16 +3149,20 @@ sub cmd_build_source {
 
 sub cmd_sbuild {
     build_source();
 
 sub cmd_sbuild {
     build_source();
-    changedir "..";
     my $pat = changespat $version;
     my $pat = changespat $version;
+    if (!$rmchanges) {
+       my @unwanted = map { s#^\.\./##; $_; } glob "../$pat";
+       @unwanted = grep { $_ ne changespat $version,'source' } @unwanted;
+       fail "changes files other than source matching $pat".
+           " already present (@unwanted);".
+           " building would result in ambiguity about the intended results"
+           if @unwanted;
+    }
+    changedir "..";
     if (act_local()) {
        stat_exists $dscfn or fail "$dscfn (in parent directory): $!";
        stat_exists $sourcechanges
            or fail "$sourcechanges (in parent directory): $!";
     if (act_local()) {
        stat_exists $dscfn or fail "$dscfn (in parent directory): $!";
        stat_exists $sourcechanges
            or fail "$sourcechanges (in parent directory): $!";
-       foreach my $cf (glob $pat) {
-           next if $cf eq $sourcechanges;
-           unlink $cf or fail "remove $cf: $!";
-       }
     }
     runcmd_ordryrun_local @sbuild, qw(-d), $isuite, @ARGV, $dscfn;
     my @changesfiles = glob $pat;
     }
     runcmd_ordryrun_local @sbuild, qw(-d), $isuite, @ARGV, $dscfn;
     my @changesfiles = glob $pat;
diff --git a/dgit.1 b/dgit.1
index 588aac66001e7703a78e48680d8784adff0879cf..87367c259869aa0a6190c504b354b5eade0647e6 100644 (file)
--- a/dgit.1
+++ b/dgit.1
@@ -127,9 +127,8 @@ Constructs the source package, uses
 .B  sbuild
 to do a binary build, and uses mergechanges to merge the source and
 binary changes files.  Options and arguments after sbuild will be
 .B  sbuild
 to do a binary build, and uses mergechanges to merge the source and
 binary changes files.  Options and arguments after sbuild will be
-passed on to sbuild.  Changes files matching
-.IB package _ version _*.changes
-in the parent directory will be removed; the output is left in
+passed on to sbuild.
+The output is left in
 .IR package \fB_\fR version \fB_multi.changes\fR.
 
 Tagging, signing and actually uploading should be left to dgit push.
 .IR package \fB_\fR version \fB_multi.changes\fR.
 
 Tagging, signing and actually uploading should be left to dgit push.