diff options
author | Sitaram Chamarty <sitaram@atc.tcs.com> | 2012-02-29 06:59:39 +0530 |
---|---|---|
committer | Sitaram Chamarty <sitaram@atc.tcs.com> | 2012-02-29 06:59:48 +0530 |
commit | a6ab6cd18d85dbe5bc0babee09501a1f5d913dab (patch) | |
tree | a4cbd3be2eec050404c00932e2c47b9b4765e13a | |
parent | gl-setup changes: (diff) | |
parent | gl-conf-convert learns '-h' (diff) | |
download | gitolite-gentoo-a6ab6cd18d85dbe5bc0babee09501a1f5d913dab.tar.gz gitolite-gentoo-a6ab6cd18d85dbe5bc0babee09501a1f5d913dab.tar.bz2 gitolite-gentoo-a6ab6cd18d85dbe5bc0babee09501a1f5d913dab.zip |
merge all the '-h' related changes
run through the main test suite, (which really only uses 2 of these
programs), smoke tested the others, but not rigorously tested otherwise
-rwxr-xr-x | src/gl-admin-push | 9 | ||||
-rwxr-xr-x | src/gl-conf-convert | 4 | ||||
-rwxr-xr-x | src/gl-dryrun | 8 | ||||
-rwxr-xr-x | src/gl-mirror-shell | 7 | ||||
-rwxr-xr-x | src/gl-system-install | 17 | ||||
-rwxr-xr-x | src/gl-tool | 2 | ||||
-rwxr-xr-x | src/sshkeys-lint | 5 |
7 files changed, 43 insertions, 9 deletions
diff --git a/src/gl-admin-push b/src/gl-admin-push index 4031e93..cd71137 100755 --- a/src/gl-admin-push +++ b/src/gl-admin-push @@ -1,6 +1,15 @@ #!/bin/sh die() { echo "$@" >&2; exit 1; } +if [ "$1" = "-h" ] +then + echo Usage: + echo " gl-admin-push [any options applicable to 'git push' command]" + echo + echo "Please see the 'gl-admin-push: ...' section in doc/tips-notes.mkd (Online at" + echo " http://sitaramc.github.com/gitolite/adminpush.html)" + exit 1 +fi # ---------- diff --git a/src/gl-conf-convert b/src/gl-conf-convert index 1faca4f..7b0bfee 100755 --- a/src/gl-conf-convert +++ b/src/gl-conf-convert @@ -9,6 +9,10 @@ use strict; use warnings; +if (not @ARGV and -t or $ARGV[0] eq '-h') { + print "Usage:\n gl-conf-convert < gitosis.conf > gitolite.conf\n(please the documentation for more)\n"; + exit 1; +} my @comments = (); my $groupname; diff --git a/src/gl-dryrun b/src/gl-dryrun index 2ebd198..5943433 100755 --- a/src/gl-dryrun +++ b/src/gl-dryrun @@ -11,7 +11,7 @@ cat <<EOFU This is a quick hack. It is not "production quality". Resist the temptation to turn this into an update.secondary hook and put it on the server. I WILL NOT BE RESPONSIBLE FOR ANY PROBLEMS IF YOU DO THAT. (Even more so if you use -'git checkout $3' *without* setting GIT_INDEX_FILE to something temporary, and +'git checkout' *without* setting GIT_INDEX_FILE to something temporary, and eventually realise that *deleted* files don't stay deleted...! And if you didn't understand that, all the more reason not to do it). @@ -35,6 +35,8 @@ EOFU exit 1; } +[ "$1" = "-h" ] && usage + [ -n "$1" ] || die "need an admin username" admin="$1"; shift @@ -69,7 +71,7 @@ $GL_CONF_COMPILED="$GL_ADMINDIR/conf/gitolite.conf-compiled.pm"; $GL_WILDREPOS = 1; $PROJECTS_LIST = $ENV{PWD} . "/projects.list"; $REPO_UMASK = 0077; -$GL_BIG_CONFIG = 0; +$GL_BIG_CONFIG = 1; $GL_NO_DAEMON_NO_GITWEB = 1; $GIT_PATH=""; $GL_GITCONFIG_KEYS = ".*"; @@ -86,7 +88,7 @@ EOF # now compile it echo compiling... -$GL_BINDIR/gl-compile-conf +$GL_BINDIR/gl-compile-conf || die "compile failed; aborting rest of run" echo echo "checking if $admin has push rights..." diff --git a/src/gl-mirror-shell b/src/gl-mirror-shell index d2b6489..e6b25c6 100755 --- a/src/gl-mirror-shell +++ b/src/gl-mirror-shell @@ -39,6 +39,11 @@ die "fatal: GL_HOSTNAME not set in rc; mirroring disabled\n" unless $GL_HOSTNAME # ---------------------------------------------------------------------------- +die "please read the gitolite mirroring documentation; this program is too +critical for you to just run it based on a 'usage' message.\n" if not @ARGV or $ARGV[0] eq '-h'; + +# ---------------------------------------------------------------------------- + # deal with local invocations first # on the "master", run from a shell, for one specific repo, with an optional @@ -77,8 +82,6 @@ if ( ($ARGV[0] || '') eq 'request-push' and not $ENV{SSH_ORIGINAL_COMMAND} ) { exit 0; } -unless (@ARGV) { print STDERR "fatal: missing command\n"; exit 1; } - # ---------- # now the remote invocations; log it, then get the sender name diff --git a/src/gl-system-install b/src/gl-system-install index 834775c..99cf075 100755 --- a/src/gl-system-install +++ b/src/gl-system-install @@ -53,7 +53,7 @@ exit 0; sub check_args { return unless @ARGV; return if @ARGV == 3; - die "I need all 3 directories (bin-dir, conf-dir, hooks-dir) or none\n"; + usage(); } sub argv_or_defaults { @@ -127,3 +127,18 @@ sub path_advice { $path_advice; #>>> } + +sub usage { + print " +Usage: + gl-system-install [bin-dir conf-dir hooks-dir] + +Requires all 3 arguments or none. All arguments supplied must be absolute +paths. The following defaults are used if arguments are not supplied: + + as normal user: \$HOME/bin, \$HOME/share/gitolite/conf, \$HOME/share/gitolite/hooks + as root: /usr/local/bin, /var/gitolite/conf, /var/gitolite/hooks +"; + exit 1; +} + diff --git a/src/gl-tool b/src/gl-tool index 256a47a..d95a3bc 100755 --- a/src/gl-tool +++ b/src/gl-tool @@ -13,7 +13,7 @@ use gitolite_rc; use gitolite; sub usage { print <DATA>; exit 1; } -usage() unless (@ARGV); +usage() if (not @ARGV) or $ARGV[0] eq '-h'; my $cmd = shift; my $pub = shift; diff --git a/src/sshkeys-lint b/src/sshkeys-lint index 96c027f..a18a306 100755 --- a/src/sshkeys-lint +++ b/src/sshkeys-lint @@ -8,7 +8,8 @@ use warnings; use Getopt::Long; my $admin = 0; my $quiet = 0; -GetOptions('admin|a=s' => \$admin, 'quiet|q' => \$quiet); +my $help = 0; +GetOptions('admin|a=s' => \$admin, 'quiet|q' => \$quiet, 'help|h' => $help); use Data::Dumper; $Data::Dumper::Deepcopy = 1; @@ -31,7 +32,7 @@ sub msg { print "sshkeys-lint: " . ( $warning ? "WARNING: " : "" ) . $_ for @_; } -@ARGV or not -t or usage(); +usage() if not @ARGV and -t or $help; our @pubkeyfiles = @ARGV; @ARGV = (); # ------------------------------------------------------------------------ |