diff options
-rw-r--r-- | Debian/Dgit.pm | 2 | ||||
-rwxr-xr-x | dgit | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/Debian/Dgit.pm b/Debian/Dgit.pm index 314bd8c..5a7b59d 100644 --- a/Debian/Dgit.pm +++ b/Debian/Dgit.pm @@ -50,6 +50,7 @@ BEGIN { git_get_ref git_for_each_ref git_for_each_tag_referring is_fast_fwd $package_re $component_re $deliberately_re + $distro_re $branchprefix initdebug enabledebug enabledebuglevel printdebug debugcmd @@ -65,6 +66,7 @@ our @EXPORT_OK; our $package_re = '[0-9a-z][-+.0-9a-z]*'; our $component_re = '[0-9a-zA-Z][-+.0-9a-zA-Z]*'; our $deliberately_re = "(?:TEST-)?$package_re"; +our $distro_re = $component_re; our $branchprefix = 'dgit'; # policy hook exit status bits @@ -727,7 +727,10 @@ sub access_basedistro () { sub access_nomdistro () { my $base = access_basedistro(); - return cfg("dgit-distro.$base.nominal-distro",'RETURN-UNDEF') // $base; + my $r = cfg("dgit-distro.$base.nominal-distro",'RETURN-UNDEF') // $base; + $r =~ m/^$distro_re$/ or badcfg + "bad syntax for (nominal) distro \`$r' (does not match /^$distro_re$/)"; + return $r; } sub access_quirk () { |