diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2016-11-06 18:26:01 +0000 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2016-11-06 18:27:30 +0000 |
commit | 5dd559b5eaedf57a1081c03ab8602669c9e72e4a (patch) | |
tree | 8a198767db4cebd216514217b1a752a861306784 | |
parent | 0e7753f7935b97bb3f7e3921651006e41bff0cca (diff) |
dgit: config: Allow dgit-suite.PATTERN.distro
This is going to be useful for *-security.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
-rw-r--r-- | debian/control | 2 | ||||
-rwxr-xr-x | dgit | 16 | ||||
-rw-r--r-- | dgit.1 | 3 |
3 files changed, 18 insertions, 3 deletions
diff --git a/debian/control b/debian/control index 347caf7..8a2ad1a 100644 --- a/debian/control +++ b/debian/control @@ -14,7 +14,7 @@ Depends: perl, libwww-perl, libdpkg-perl, git-core, devscripts, dpkg-dev, coreutils (>= 8.23-1~) | realpath, libdigest-sha-perl, dput, curl, libjson-perl, ca-certificates, - libtext-iconv-perl + libtext-iconv-perl, libtext-glob-perl Recommends: ssh-client, libtext-iconv-perl Suggests: sbuild Architecture: all @@ -36,6 +36,7 @@ use Digest::SHA; use Digest::MD5; use List::Util qw(any); use List::MoreUtils qw(pairwise); +use Text::Glob qw(match_glob); use Carp; use Debian::Dgit; @@ -694,8 +695,19 @@ sub access_basedistro () { if (defined $idistro) { return $idistro; } else { - return cfg("dgit-suite.$isuite.distro", - "dgit.default.distro"); + my $def = cfg("dgit-suite.$isuite.distro", 'RETURN-UNDEF'); + return $def if defined $def; + foreach my $src (@gitcfgsources, 'internal') { + my $kl = $src eq 'internal' ? \%defcfg : $gitcfgs{$src}; + next unless $kl; + foreach my $k (keys %$kl) { + next unless $k =~ m#^dgit-suite\.(.*)\.distro$#; + my $dpat = $1; + next unless match_glob $dpat, $isuite; + return $kl->{$k}; + } + } + return cfg("dgit.default.distro"); } } @@ -879,6 +879,9 @@ Settings likely to be useful for an end user include: Specifies the distro for a suite. dgit keys off the suite name (which appears in changelogs etc.), and uses that to determine the distro which is involved. The config used is thereafter that for the distro. + +.I suite +may be a glob pattern. .TP .BI dgit.default.distro " distro" The default distro for an unknown suite. |