From 1d74cb1f1941d3a95a9fb0b9180c796f16c0d5b1 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 22 Sep 2016 12:59:18 +0100 Subject: Split brain: Better tag format filtering The code only makes tag formats `old' and `new'. Make it easier to add a new tag format config item entry later. No functional change with existing configurations. Signed-off-by: Ian Jackson --- dgit | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'dgit') diff --git a/dgit b/dgit index 216a9c3..5dfd97c 100755 --- a/dgit +++ b/dgit @@ -534,6 +534,9 @@ our %defcfg = ('dgit.default.distro' => 'debian', 'dgit.default.archive-query' => 'madison:', 'dgit.default.sshpsql-dbname' => 'service=projectb', 'dgit.default.dgit-tag-format' => 'old,new,maint', + # old means "repo server accepts pushes with old dgit tags" + # new means "repo server accepts pushes with new dgit tags" + # maint means "repo server accepts split brain pushes" 'dgit-distro.debian.archive-query' => 'ftpmasterapi:', 'dgit-distro.debian.git-check' => 'url', 'dgit-distro.debian.git-check-suffix' => '/info/refs', @@ -1194,7 +1197,7 @@ sub select_tagformat () { die 'bug' if $tagformatfn && $tagformat_want; # ... $tagformat_want assigned after previous select_tagformat - my (@supported) = grep { $_ ne 'maint' } access_cfg_tagformats(); + my (@supported) = grep { $_ =~ m/^(?:old|new)$/ } access_cfg_tagformats(); printdebug "select_tagformat supported @supported\n"; $tagformat_want //= [ $supported[0], "distro access configuration", 0 ]; -- cgit v1.2.3