diff options
author | 2010-02-10 12:35:01 +0530 | |
---|---|---|
committer | 2010-02-13 13:02:25 +0530 | |
commit | 06d8ab4c18d158577cb1fe561a062fc3543c4f63 (patch) | |
tree | 7dfd3366c014952a2b19b779902b3519dc5c87dd | |
parent | added server-side setup script (diff) | |
download | gitolite-gentoo-06d8ab4c18d158577cb1fe561a062fc3543c4f63.tar.gz gitolite-gentoo-06d8ab4c18d158577cb1fe561a062fc3543c4f63.tar.bz2 gitolite-gentoo-06d8ab4c18d158577cb1fe561a062fc3543c4f63.zip |
make VERSION work in both types of setups
The old install method will now use conf/VERSION instead of src/VERSION everywhere.
The new one, if you use the builtin make file to "make branch.tar" will also create just such a file
-rw-r--r-- | Makefile | 8 | ||||
-rw-r--r-- | src/gitolite.pm | 4 | ||||
-rwxr-xr-x | src/gl-easy-install | 7 | ||||
-rwxr-xr-x | src/gl-install | 3 | ||||
-rwxr-xr-x | src/gl-setup | 3 |
5 files changed, 12 insertions, 13 deletions
@@ -7,10 +7,10 @@ # Note: I'm not sure if that "-r" is a GNU tar extension... .GITOLITE-VERSION: - @touch .GITOLITE-VERSION + @touch conf/VERSION %.tar: .GITOLITE-VERSION - git describe --all --long $* > .GITOLITE-VERSION + git describe --tags --long $* > conf/VERSION git archive $* > $@ - tar -r -f $@ .GITOLITE-VERSION - rm .GITOLITE-VERSION + tar -r -f $@ conf/VERSION + rm conf/VERSION diff --git a/src/gitolite.pm b/src/gitolite.pm index 5638d05..15728cc 100644 --- a/src/gitolite.pm +++ b/src/gitolite.pm @@ -34,7 +34,7 @@ our $USERNAME_PATT=qr(^\@?[0-9a-zA-Z][0-9a-zA-Z._\@+-]*$); # very simple patter our $REPOPATT_PATT=qr(^\@?[0-9a-zA-Z][\\^.$|()[\]*+?{}0-9a-zA-Z._\@/-]*$); # these come from the RC file -our ($REPO_UMASK, $GL_WILDREPOS); +our ($REPO_UMASK, $GL_WILDREPOS, $GL_PACKAGE_CONF); our %repos; # ---------------------------------------------------------------------------- @@ -282,7 +282,7 @@ sub report_basic # send back some useful info if no command was given print "hello $user, the gitolite version here is "; - system("cat", "$GL_ADMINDIR/src/VERSION"); + system("cat", ($GL_PACKAGE_CONF || "$GL_ADMINDIR/conf") . "/VERSION"); print "\ryou have the following permissions:\n\r"; for my $r (sort keys %repos) { my $perm .= ( $repos{$r}{C}{'@all'} ? ' @' : ( $repos{$r}{C}{$user} ? ' C' : ' ' ) ); diff --git a/src/gl-easy-install b/src/gl-easy-install index a8dc013..989f3a6 100755 --- a/src/gl-easy-install +++ b/src/gl-easy-install @@ -196,12 +196,12 @@ version_info() { # MANUAL: if needed, make a note of the version you are upgrading from, and to # record which version is being sent across; we assume it's HEAD - git describe --tags --long HEAD 2>/dev/null > src/VERSION || echo '(unknown)' > src/VERSION + git describe --tags --long HEAD 2>/dev/null > conf/VERSION || echo '(unknown)' > conf/VERSION # what was the old version there? export upgrade_details="you are upgrading \ - $(ssh -p $port $user@$host cat gitolite-install/src/VERSION 2>/dev/null || echo '(or installing first-time)' ) \ - to $(cat src/VERSION)" + $(ssh -p $port $user@$host cat gitolite-install/conf/VERSION 2>/dev/null || echo '(or installing first-time)' ) \ + to $(cat conf/VERSION)" prompt "$upgrade_details" "$v_upgrade_details" } @@ -283,7 +283,6 @@ copy_gl() { ssh -p $port $user@$host mkdir -p gitolite-install scp $quiet -P $port -r src conf doc hooks $user@$host:gitolite-install/ - rm -f src/VERSION # MANUAL: now log on to the server (ssh git@server) and get a command # line. This step is for your convenience; the script does it all from diff --git a/src/gl-install b/src/gl-install index 13798ae..485683a 100755 --- a/src/gl-install +++ b/src/gl-install @@ -62,6 +62,7 @@ if ($GL_PACKAGE_HOOKS) { system("cp -R $GL_PACKAGE_HOOKS $GL_ADMINDIR"); } else { system("cp -R $bindir/../src $bindir/../doc $bindir/../hooks $GL_ADMINDIR"); + system("cp $bindir/../conf/VERSION $GL_ADMINDIR/conf"); } unless (-f $GL_CONF or $GL_PACKAGE_CONF) { @@ -95,7 +96,7 @@ if ( -d "gitolite-admin.git/hooks" ) { } # fixup program renames -for my $oldname qw(pta-hook.sh conf-convert.pl 00-easy-install.sh 99-emergency-addkey.sh install.pl update-hook.pl hooks/update ga-post-update-hook) { +for my $oldname qw(pta-hook.sh conf-convert.pl 00-easy-install.sh 99-emergency-addkey.sh install.pl update-hook.pl hooks/update ga-post-update-hook VERSION) { unlink "$GL_ADMINDIR/src/$oldname"; unlink "$ENV{HOME}/gitolite-install/src/$oldname"; } diff --git a/src/gl-setup b/src/gl-setup index b48975c..25e4e0f 100755 --- a/src/gl-setup +++ b/src/gl-setup @@ -58,7 +58,6 @@ GL_ADMINDIR=$(cd;perl -e 'do ".gitolite.rc"; print $GL_ADMINDIR') REPO_BASE=$( cd;perl -e 'do ".gitolite.rc"; print $REPO_BASE' ) [[ -f $GL_ADMINDIR/conf/gitolite.conf ]] || { - echo DEBUG NO DEFAULT CONF FOUND .. CREATING .. >&2 cat <<EOF > $GL_ADMINDIR/conf/gitolite.conf repo gitolite-admin RW+ = $admin_name @@ -67,7 +66,7 @@ REPO_BASE=$( cd;perl -e 'do ".gitolite.rc"; print $REPO_BASE' ) RW+ = @all EOF } -cp $pubkey_file $GL_ADMINDIR/keydir +[[ -n $pubkey_file ]] && cp $pubkey_file $GL_ADMINDIR/keydir touch $HOME/.ssh/authorized_keys gl-compile-conf -q |