From 70010ba56ef2907f81f018fcde07db2d271ab25a Mon Sep 17 00:00:00 2001 From: Sitaram Chamarty Date: Wed, 5 Oct 2011 22:01:49 +0530 Subject: [PATCH] put single quotes around bad user/repo names etc --- src/gl-compile-conf | 10 +++++----- t/t09a-oldtests | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/gl-compile-conf b/src/gl-compile-conf index 77e451a..d812b06 100755 --- a/src/gl-compile-conf +++ b/src/gl-compile-conf @@ -143,7 +143,7 @@ sub parse_conf_line do { $groups{$1}{$_} ||= $fragment } for ( expand_list( split(' ', $2) ) ); # create the group hash even if empty $groups{$1} = {} unless $groups{$1}; - die "$ABRT bad group $1\n" unless $1 =~ $REPONAME_PATT; + die "$ABRT bad group '$1'\n" unless $1 =~ $REPONAME_PATT; } # repo(s) elsif ($line =~ /^repo (.*)/) @@ -155,9 +155,9 @@ sub parse_conf_line # ...sanity check for (@{ $repos_p }) { print STDERR "$WARN explicit '.git' extension ignored for $_.git\n" if s/\.git$//; - die "$ABRT bad reponame $_\n" + die "$ABRT bad reponame '$_'\n" if ($GL_WILDREPOS and $_ !~ $REPOPATT_PATT); - die "$ABRT bad reponame $_ or you forgot to set \$GL_WILDREPOS\n" + 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_p }; @@ -182,7 +182,7 @@ sub parse_conf_line # expand the user list, unless it is just "@all" @users = expand_list ( @users ) unless $GL_BIG_CONFIG; - do { die "$ABRT bad username $_\n" unless $_ =~ $USERNAME_PATT } for @users; + do { die "$ABRT bad username '$_'\n" unless $_ =~ $USERNAME_PATT } for @users; s/\bCREAT[EO]R\b/~\$creator/g for @users; @@ -289,7 +289,7 @@ sub parse_conf_line elsif ($line =~ /^(\S+)(?: "(.*?)")? = "(.*)"$/) { my ($repo, $owner, $desc) = ($1, $2, $3); - die "$ABRT bad repo name $repo\n" unless $repo =~ $REPONAME_PATT; + die "$ABRT bad repo name '$repo'\n" unless $repo =~ $REPONAME_PATT; die "$ABRT $fragment attempting to set description for $repo\n" if check_fragment_repo_disallowed( $fragment, $repo ); $desc{"$repo.git"} = $desc; $owner{"$repo.git"} = $owner || ''; diff --git a/t/t09a-oldtests b/t/t09a-oldtests index 5e6e178..e301da1 100644 --- a/t/t09a-oldtests +++ b/t/t09a-oldtests @@ -11,7 +11,7 @@ echo " expect "To gitolite:gitolite-admin" expect "master -> master" [[ $1 == 0 ]] && expect "ABORTING" -[[ $1 == 0 ]] && expect "bad reponame abc\*def or you forgot to set .GL_WILDREPOS" +[[ $1 == 0 ]] && expect "bad reponame 'abc\*def' or you forgot to set .GL_WILDREPOS" name "bad user name" echo " @@ -22,7 +22,7 @@ echo " RW = sitaram " | ugc -r expect "ABORTING" -expect "bad username sitaram\*tester" +expect "bad username 'sitaram\*tester'" name "NAME deny" echo "