chiark / gitweb /
dgit: Enforce a syntax for nominal distros
[dgit.git] / dgit
diff --git a/dgit b/dgit
index 54b0e6fc7719237d1d357459edfb6e2a3d360c62..de7b4de625ec4520ff13d552cee200172d76c3b3 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -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 () {