(minor) more helpful message when the user forgot to set $GL_WILDREPOS

thanks to konrad for catching this

also make lack of WILDREPOS more noticable on compile
This commit is contained in:
Sitaram Chamarty 2010-04-25 13:49:19 +05:30
parent 6c682721b5
commit f1a942b7f7

View file

@ -185,7 +185,12 @@ sub parse_conf_file
@repos = split ' ', $1; @repos = split ' ', $1;
unless (@repos == 1 and $repos[0] eq '@all') { unless (@repos == 1 and $repos[0] eq '@all') {
@repos = expand_list ( @repos ); @repos = expand_list ( @repos );
do { die "$ABRT bad reponame $_\n" unless ($GL_WILDREPOS ? $_ =~ $REPOPATT_PATT : $_ =~ $REPONAME_PATT) } for @repos; for (@repos) {
die "$ABRT bad reponame $_\n"
if ($GL_WILDREPOS and $_ !~ $REPOPATT_PATT);
die "$ABRT bad reponame $_ or you forgot to set \$GL_WILDREPOS\n"
if (not $GL_WILDREPOS and $_ !~ $REPONAME_PATT);
}
} }
s/\bCREAT[EO]R\b/\$creator/g for @repos; s/\bCREAT[EO]R\b/\$creator/g for @repos;
} }
@ -196,7 +201,7 @@ sub parse_conf_file
my @refs; @refs = split(' ', $2) if $2; my @refs; @refs = split(' ', $2) if $2;
@refs = expand_list ( @refs ); @refs = expand_list ( @refs );
my @users = split ' ', $3; my @users = split ' ', $3;
die "wildrepos disabled, cant use 'C' in config\n" if $perms eq 'C' and not $GL_WILDREPOS; die "$ABRT \$GL_WILDREPOS is not set, you cant use 'C' in config\n" if $perms eq 'C' and not $GL_WILDREPOS;
# if no ref is given, this PERM applies to all refs # if no ref is given, this PERM applies to all refs
@refs = qw(refs/.*) unless @refs; @refs = qw(refs/.*) unless @refs;