From 3d44b003c844e48f58e84c08d13fd998e50b7e59 Mon Sep 17 00:00:00 2001 From: Sitaram Chamarty Date: Thu, 10 Sep 2009 19:05:07 +0530 Subject: [PATCH] clarifications in various messages etc (thanks to SethX for feedback) - install: a little more verbosity in the mkdir - install and example conf: some of the help text made more clear - auth: error message on bad $cmd is now clearer, plus no perl-warnings to confuse people --- conf/example.conf | 3 +++ src/gl-auth-command | 8 +++----- src/install.pl | 9 +++++++-- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/conf/example.conf b/conf/example.conf index f19a95a..8f018ee 100644 --- a/conf/example.conf +++ b/conf/example.conf @@ -40,6 +40,9 @@ # notes: +# - the reponame is a simple name. Do not add the ".git" extension -- +# that will be added by the program when the actual repo is created + # - RW+ means non-ff push is allowed # - you can't write just "W" or "+"; it has to be R, or RW, or RW+ diff --git a/src/gl-auth-command b/src/gl-auth-command index 6a8632c..4fc757d 100755 --- a/src/gl-auth-command +++ b/src/gl-auth-command @@ -70,11 +70,9 @@ die "$cmd??? you're a funny guy..." # including the single quotes my ($verb, $repo) = ($cmd =~ /^\s*(git\s+\S+|\S+)\s+'\/?(.*).git'/); -die "$verb? I don't do odd jobs, sorry..." - unless $verb =~ $R_COMMANDS or $verb =~ $W_COMMANDS; - -die "I don't like the look of $repo, sorry!" - unless $repo =~ $REPONAME_PATT; +die "Sorry, I don't like the command you gave me: $cmd\n" + unless ( ( $verb =~ $R_COMMANDS or $verb =~ $W_COMMANDS ) + and $repo =~ $REPONAME_PATT ); # ---------------------------------------------------------------------------- # first level permissions check diff --git a/src/install.pl b/src/install.pl index 6586ef2..85b8607 100755 --- a/src/install.pl +++ b/src/install.pl @@ -10,7 +10,12 @@ our ($REPO_BASE, $GL_ADMINDIR, $GL_CONF); sub wrap_mkdir { my $dir = shift; - -d $dir or mkdir($dir) or die "mkdir $dir failed: $!\n"; + if ( -d $dir ) { + print STDERR "$dir already exists\n"; + return; + } + mkdir($dir) or die "mkdir $dir failed: $!\n"; + print STDERR "created $dir\n"; } # the only path that is *fixed* (can't be changed without changing all 3 @@ -21,7 +26,7 @@ unless (-f $glrc) { # doesn't exist. Copy it across, tell user to edit it and come back system("cp conf/example.gitolite.rc $glrc"); print STDERR "created $glrc\n"; - print STDERR "please edit it, set the paths as you like, and rerun this script\n"; + print STDERR "please edit it, change the paths if you wish to, and RERUN THIS SCRIPT\n"; exit; }