+ badcfg "need value for one of: @_\n".
+ "$us: distro or suite appears not to be (properly) supported";
+}
+
+sub access_basedistro () {
+ if (defined $idistro) {
+ return cfg("dgit-distro.basedistro.distro",
+ "dgit-suite.$isuite.distro",
+ 'RETURN-UNDEF') // $idistro;
+ } else {
+ return cfg("dgit-suite.$isuite.distro",
+ "dgit.default.distro");
+ }
+}
+
+sub access_quirk () {
+ # returns (quirk name, distro to use instead, quirk-specific info)
+ my $basedistro = access_basedistro();
+ my $backports_quirk = cfg("dgit-distro.$basedistro.backports-quirk",
+ 'RETURN-UNDEF');
+ if (defined $backports_quirk) {
+ my $re = $backports_quirk;
+ $re =~ s/[^-0-9a-z_\%*()]/\\$&/ig;
+ $re =~ s/\*/.*/g;
+ $re =~ s/\%/([-0-9a-z_]+)/
+ or $re =~ m/[()]/ or badcfg "backports-quirk needs \% or ( )";
+ if ($isuite =~ m/^$re$/) {
+ return ('backports',"$basedistro-backports",$1);
+ }
+ }
+ return ('none',$basedistro);