From 76c7db35e2ddaa0c517128fae11cd5893099fffc Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 7 Jan 2017 18:45:59 +0000 Subject: dgit: Enforce a syntax for nominal distros These appear in various interchange output like tags. They should be sane. They're going to appear in Dgit: too where people will need to use them. Signed-off-by: Ian Jackson --- dgit | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'dgit') diff --git a/dgit b/dgit index 54b0e6f..de7b4de 100755 --- 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 () { -- cgit v1.2.3