chiark / gitweb /
dgit: Rename $suppress_clean to $clean_using_builder (nfc)
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 4 Jun 2016 17:31:53 +0000 (18:31 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 16 Jul 2016 15:47:47 +0000 (16:47 +0100)
This variable name was very confusing.  Also, add a comment explaining
the semantics.

dgit

diff --git a/dgit b/dgit
index 1477d17..4b4380b 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -3220,10 +3220,14 @@ sub quilt_fixup_editor () {
 
 #----- other building -----
 
-our $suppress_clean;
+our $clean_using_builder;
+# ^ tree is to be cleaned by dpkg-source's builtin idea that it should
+#   clean the tree before building (perhaps invoked indirectly by
+#   whatever we are using to run the build), rather than separately
+#   and explicitly by us.
 
 sub clean_tree () {
-    return if $suppress_clean;
+    return if $clean_using_builder;
     if ($cleanmode eq 'dpkg-source') {
        runcmd_ordryrun_local @dpkgbuildpackage, qw(-T clean);
     } elsif ($cleanmode eq 'dpkg-source-d') {
@@ -3328,7 +3332,7 @@ sub massage_dbp_args ($;$) {
     debugcmd '#massaging#', @$cmd if $debuglevel>1;
 #print STDERR "MASS0 ",Dumper($cmd, $xargs, $need_split_build_invocation);
     if ($cleanmode eq 'dpkg-source' && !$need_split_build_invocation) {
-       $suppress_clean = 1;
+       $clean_using_builder = 1;
        return 0;
     }
     # -nc has the side effect of specifying -b if nothing else specified
@@ -3388,7 +3392,7 @@ sub cmd_gbp_build {
     if ($wantsrc > 0) {
        build_source();
     } else {
-       if (!$suppress_clean) {
+       if (!$clean_using_builder) {
            push @cmd, '--git-cleaner=true';
        }
        build_prep();
@@ -3408,7 +3412,7 @@ sub cmd_git_build { cmd_gbp_build(); } # compatibility with <= 1.0
 sub build_source {
     if ($cleanmode =~ m/^dpkg-source/) {
        # dpkg-source will clean, so we shouldn't
-       $suppress_clean = 1;
+       $clean_using_builder = 1;
     }
     build_prep();
     $sourcechanges = changespat $version,'source';