From: Ian Jackson Date: Sun, 8 Jan 2017 11:26:24 +0000 (+0000) Subject: dgit: Support distro aliases X-Git-Tag: archive/debian/3.0~55 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=1af545d050a9f129e7e42ec6fd2763fd8a3514aa;p=dgit.git dgit: Support distro aliases We are going to use this to spot when we accidentally look up "debian" information in the test suite. Signed-off-by: Ian Jackson --- diff --git a/debian/changelog b/debian/changelog index d3d41b39..f404d5aa 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,6 +10,9 @@ dgit (3.0~) unstable; urgency=medium * dgit config handling: Honour command-line and context-provided suite and distro more reliably and consistently. + Minor new feature: + * distro alias facility in config space. (Primarily for testing.) + dgit-badcommit-fixup: * Do not investigate symrefs. Closes:#850547. diff --git a/dgit b/dgit index 3ffcf77a..02d0b929 100755 --- a/dgit +++ b/dgit @@ -691,7 +691,7 @@ sub cfg { "$us: distro or suite appears not to be (properly) supported"; } -sub access_basedistro () { +sub access_basedistro__noalias () { if (defined $idistro) { return $idistro; } else { @@ -711,6 +711,12 @@ sub access_basedistro () { } } +sub access_basedistro () { + my $noalias = access_basedistro__noalias(); + my $canon = cfg("dgit-distro.$noalias.alias-canon",'RETURN-UNDEF'); + return $canon // $noalias; +} + sub access_nomdistro () { my $base = access_basedistro(); my $r = cfg("dgit-distro.$base.nominal-distro",'RETURN-UNDEF') // $base;