chiark / gitweb /
By default, generate a DEP-14 tag as well as a dgit archive/* tag
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 15 Dec 2016 00:54:21 +0000 (00:54 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 19 Dec 2016 16:58:57 +0000 (16:58 +0000)
Even in non-split-view quilt modes.  Closes:#844129.

This breaks one of the test suite test cases, so disable it there.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
debian/changelog
dgit
dgit.1
tests/tests/trustingpolicy-replay

index 91f52da3112634c7ead1a39e7ddf84fc440d0a95..bb5db14a5219e97c717579821ff36c0da9c37da7 100644 (file)
@@ -15,6 +15,8 @@ dgit (2.12~) unstable; urgency=medium
     instead.  Closes:#844570.
   * Suppress some leftover debugging output from import-dsc.
     Closes:#847658.
     instead.  Closes:#844570.
   * Suppress some leftover debugging output from import-dsc.
     Closes:#847658.
+  * By default, generate a DEP-14 tag as well as a dgit archive/*
+    tag, even in non-split-view quilt modes.  Closes:#844129.
 
   Test suite:
   * Provide and use stunt lintian and debuild, to avoid lintian
 
   Test suite:
   * Provide and use stunt lintian and debuild, to avoid lintian
diff --git a/dgit b/dgit
index 1a23d1a712c52ce528cf62dca26cb054a84e6960..7996227a9d4895216eb722111b4aaee699206afc 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -69,6 +69,8 @@ our $rmchanges;
 our $overwrite_version; # undef: not specified; '': check changelog
 our $quilt_mode;
 our $quilt_modes_re = 'linear|smash|auto|nofix|nocheck|gbp|dpm|unapplied';
 our $overwrite_version; # undef: not specified; '': check changelog
 our $quilt_mode;
 our $quilt_modes_re = 'linear|smash|auto|nofix|nocheck|gbp|dpm|unapplied';
+our $dodep14tag;
+our $dodep14tag_re = 'want|no|always';
 our $split_brain_save;
 our $we_are_responder;
 our $initiator_tempdir;
 our $split_brain_save;
 our $we_are_responder;
 our $initiator_tempdir;
@@ -3674,7 +3676,21 @@ sub push_tagwants ($$$$) {
            TfSuffix => '-maintview',
             View => 'maint',
         };
            TfSuffix => '-maintview',
             View => 'maint',
         };
-    }
+    } elsif ($dodep14tag eq 'no' ? 0
+            : $dodep14tag eq 'want' ? access_cfg_tagformats_can_splitbrain
+            : $dodep14tag eq 'always'
+            ? (access_cfg_tagformats_can_splitbrain or fail <<END)
+--dep14tag-always (or equivalent in config) means server must support
+ both "new" and "maint" tag formats, but config says it doesn't.
+END
+           : die "$dodep14tag ?") {
+       push @tagwants, {
+           TagFn => \&debiantag_maintview,
+           Objid => $dgithead,
+           TfSuffix => '-dgit',
+           View => 'dgit',
+        };
+    };
     foreach my $tw (@tagwants) {
        $tw->{Tag} = $tw->{TagFn}($cversion, access_nomdistro);
        $tw->{Tfn} = sub { $tfbase.$tw->{TfSuffix}.$_[0]; };
     foreach my $tw (@tagwants) {
        $tw->{Tag} = $tw->{TagFn}($cversion, access_nomdistro);
        $tw->{Tfn} = sub { $tfbase.$tw->{TfSuffix}.$_[0]; };
@@ -6095,6 +6111,15 @@ sub parseopts () {
            } elsif (m/^--overwrite=(.+)$/s) {
                push @ropts, $_;
                $overwrite_version = $1;
            } elsif (m/^--overwrite=(.+)$/s) {
                push @ropts, $_;
                $overwrite_version = $1;
+           } elsif (m/^--dep14tag$/s) {
+               push @ropts, $_;
+               $dodep14tag= 'want';
+           } elsif (m/^--no-dep14tag$/s) {
+               push @ropts, $_;
+               $dodep14tag= 'no';
+           } elsif (m/^--always-dep14tag$/s) {
+               push @ropts, $_;
+               $dodep14tag= 'always';
            } elsif (m/^--delayed=(\d+)$/s) {
                push @ropts, $_;
                push @dput, $_;
            } elsif (m/^--delayed=(\d+)$/s) {
                push @ropts, $_;
                push @dput, $_;
@@ -6279,6 +6304,14 @@ if (!defined $quilt_mode) {
     $quilt_mode = $1;
 }
 
     $quilt_mode = $1;
 }
 
+if (!defined $dodep14tag) {
+    local $access_forpush;
+    $dodep14tag = access_cfg('dep14tag', 'RETURN-UNDEF') // 'want';
+    $dodep14tag =~ m/^($dodep14tag_re)$/ 
+       or badcfg "unknown dep14tag setting \`$dodep14tag'";
+    $dodep14tag = $1;
+}
+
 $need_split_build_invocation ||= quiltmode_splitbrain();
 
 if (!defined $cleanmode) {
 $need_split_build_invocation ||= quiltmode_splitbrain();
 
 if (!defined $cleanmode) {
diff --git a/dgit.1 b/dgit.1
index 33d24a95a11b831b8712d9859cfeba1e47a0c9e7..63a70217ce07dc372f97942a35227097589020d8 100644 (file)
--- a/dgit.1
+++ b/dgit.1
@@ -665,6 +665,24 @@ By default, dgit looks in the parent directory
 .BI --no-rm-on-error
 Do not delete the destination directory if clone fails.
 .TP
 .BI --no-rm-on-error
 Do not delete the destination directory if clone fails.
 .TP
+.BI --dep14tag
+Generates a DEP-14 tag (eg
+.BR debian/ \fIversion\fR)
+as well as a dgit tag (eg
+.BR archive/debian/ \fIversion\fR)
+where possible.  This is the default.
+.TP
+.BI --no-dep14tag
+Do not generate a DEP-14 tag, except in split quilt view mode.
+(On servers where only the old tag format is supported,
+the dgit tag will have the DEP-14 name.
+This option does not prevent that.)
+.TP
+.BI --dep14tag-always
+Insist on generating a DEP-14 tag
+as well as a dgit tag.
+If the server does not support that, dgit push will fail.
+.TP
 .BI -D
 Prints debugging information to stderr.  Repeating the option produces
 more output (currently, up to -DDDD is meaningfully different).
 .BI -D
 Prints debugging information to stderr.  Repeating the option produces
 more output (currently, up to -DDDD is meaningfully different).
@@ -999,6 +1017,8 @@ or when pushing and
 .TP
 .BI dgit-distro. distro .dgit-tag-format
 .TP
 .TP
 .BI dgit-distro. distro .dgit-tag-format
 .TP
+.BR dgit-distro. \fIdistro\fR .dep14tag " " want | no | always
+.TP
 .BI dgit-distro. distro .ssh
 .TP
 .BI dgit-distro. distro .sshpsql-dbname
 .BI dgit-distro. distro .ssh
 .TP
 .BI dgit-distro. distro .sshpsql-dbname
index 8cc205ce1dfdfece7d1f89840f9e6ecb0cbda913..2039ec6c243db92b40dae0b15d946cb870e0cde8 100755 (executable)
@@ -4,6 +4,8 @@ set -e
 
 t-tstunt-parsechangelog
 
 
 t-tstunt-parsechangelog
 
+t-git-config dgit.default.dep14tag no
+
 t-dsd
 t-policy dgit-repos-policy-trusting
 t-prep-newpackage example 1.0
 t-dsd
 t-policy dgit-repos-policy-trusting
 t-prep-newpackage example 1.0