summaryrefslogtreecommitdiff
path: root/dgit
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2016-07-31 17:43:59 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2016-09-05 13:41:47 +0100
commit11f333c91765e0852f28807463d9302bad75d262 (patch)
tree12d74592a4d0d2f3bc4d12fc519bf055a21891e1 /dgit
parent496685d614bba3670ba89fda0802750b8ac54a9d (diff)
Split tags: Preparation: move select_tagformat into a new section
No functional change. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'dgit')
-rwxr-xr-xdgit56
1 files changed, 29 insertions, 27 deletions
diff --git a/dgit b/dgit
index 4aefa08..495a043 100755
--- a/dgit
+++ b/dgit
@@ -1132,6 +1132,35 @@ sub archive_query_dummycat ($$) {
return sort { -version_compare($a->[0],$b->[0]); } @rows;
}
+#---------- tag format handling ----------
+
+sub select_tagformat () {
+ # sets $tagformatfn
+ return if $tagformatfn && !$tagformat_want;
+ die 'bug' if $tagformatfn && $tagformat_want;
+ # ... $tagformat_want assigned after previous select_tagformat
+
+ my (@supported) = split /\,/, access_cfg('dgit-tag-format');
+ printdebug "select_tagformat supported @supported\n";
+
+ $tagformat_want //= [ $supported[0], "distro access configuration", 0 ];
+ printdebug "select_tagformat specified @$tagformat_want\n";
+
+ my ($fmt,$why,$override) = @$tagformat_want;
+
+ fail "target distro supports tag formats @supported".
+ " but have to use $fmt ($why)"
+ unless $override
+ or grep { $_ eq $fmt } @supported;
+
+ $tagformat_want = undef;
+ $tagformat = $fmt;
+ $tagformatfn = ${*::}{"debiantag_$fmt"};
+
+ fail "trying to use unknown tag format \`$fmt' ($why) !"
+ unless $tagformatfn;
+}
+
#---------- archive query entrypoints and rest of program ----------
sub canonicalise_suite () {
@@ -1241,33 +1270,6 @@ sub create_remote_git_repo () {
}
}
-sub select_tagformat () {
- # sets $tagformatfn
- return if $tagformatfn && !$tagformat_want;
- die 'bug' if $tagformatfn && $tagformat_want;
- # ... $tagformat_want assigned after previous select_tagformat
-
- my (@supported) = split /\,/, access_cfg('dgit-tag-format');
- printdebug "select_tagformat supported @supported\n";
-
- $tagformat_want //= [ $supported[0], "distro access configuration", 0 ];
- printdebug "select_tagformat specified @$tagformat_want\n";
-
- my ($fmt,$why,$override) = @$tagformat_want;
-
- fail "target distro supports tag formats @supported".
- " but have to use $fmt ($why)"
- unless $override
- or grep { $_ eq $fmt } @supported;
-
- $tagformat_want = undef;
- $tagformat = $fmt;
- $tagformatfn = ${*::}{"debiantag_$fmt"};
-
- fail "trying to use unknown tag format \`$fmt' ($why) !"
- unless $tagformatfn;
-}
-
our ($dsc_hash,$lastpush_hash);
our $ud = '.git/dgit/unpack';