From 550d6b79b1e08ab7ce7a55193fcf4846a0cb6ad1 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 24 Sep 2013 15:15:44 +0200 Subject: [PATCH] Allow dots in jobset names (like "release-13.09") --- src/lib/Hydra/Controller/Jobset.pm | 2 +- src/lib/Hydra/Helper/CatalystUtils.pm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/Hydra/Controller/Jobset.pm b/src/lib/Hydra/Controller/Jobset.pm index 7ef7c680..4d6db815 100644 --- a/src/lib/Hydra/Controller/Jobset.pm +++ b/src/lib/Hydra/Controller/Jobset.pm @@ -366,7 +366,7 @@ sub clone_submit : Chained('jobsetChain') PathPart('clone/submit') Args(0) { requirePost($c); my $newJobsetName = trim $c->stash->{params}->{"newjobset"}; - error($c, "Invalid jobset name: $newJobsetName") unless $newJobsetName =~ /^[[:alpha:]][\w\-]*$/; + error($c, "Invalid jobset name: $newJobsetName") if $newJobsetName !~ /^$jobsetNameRE$/; my $newJobset; txn_do($c->model('DB')->schema, sub { diff --git a/src/lib/Hydra/Helper/CatalystUtils.pm b/src/lib/Hydra/Helper/CatalystUtils.pm index 67bfe88e..9f257418 100644 --- a/src/lib/Hydra/Helper/CatalystUtils.pm +++ b/src/lib/Hydra/Helper/CatalystUtils.pm @@ -215,7 +215,7 @@ Readonly our $relPathRE => "(?:$pathCompRE(?:/$pathCompRE)*)"; Readonly our $relNameRE => "(?:[A-Za-z0-9-_][A-Za-z0-9-\._]*)"; Readonly our $attrNameRE => "(?:[A-Za-z_][A-Za-z0-9-_]*)"; Readonly our $projectNameRE => "(?:[A-Za-z_][A-Za-z0-9-_]*)"; -Readonly our $jobsetNameRE => "(?:[A-Za-z_][A-Za-z0-9-_]*)"; +Readonly our $jobsetNameRE => "(?:[A-Za-z_][A-Za-z0-9-_\.]*)"; Readonly our $jobNameRE => "(?:$attrNameRE(?:\\.$attrNameRE)*)"; Readonly our $systemRE => "(?:[a-z0-9_]+-[a-z0-9_]+)"; Readonly our $userNameRE => "(?:[a-z][a-z0-9_\.]*)";