diff -U3 -r sitaramc-gitolite-367e8f8.orig/hooks/gitolite-admin/post-update sitaramc-gitolite-367e8f8/hooks/gitolite-admin/post-update
--- sitaramc-gitolite-367e8f8.orig/hooks/gitolite-admin/post-update 2010-03-11 23:38:51.000000000 -0600
+++ sitaramc-gitolite-367e8f8/hooks/gitolite-admin/post-update 2010-03-25 06:36:29.510974819 -0500
@@ -5,4 +5,4 @@
GIT_WORK_TREE=$GL_ADMINDIR git checkout -f master
cd $GL_ADMINDIR
-$GL_BINDIR/gl-compile-conf
+gl-compile-conf
diff -U3 -r sitaramc-gitolite-367e8f8.orig/src/gitolite.pm sitaramc-gitolite-367e8f8/src/gitolite.pm
--- sitaramc-gitolite-367e8f8.orig/src/gitolite.pm 2010-03-11 23:38:51.000000000 -0600
+++ sitaramc-gitolite-367e8f8/src/gitolite.pm 2010-03-25 06:38:50.062978438 -0500
@@ -285,7 +285,7 @@
# send back some useful info if no command was given
print "hello $user, the gitolite version here is ";
- system("cat", ($GL_PACKAGE_CONF || "$GL_ADMINDIR/conf") . "/VERSION");
+ system("rpm", "-q", "--qf", '%{version}-%{release}', 'gitolite');
print "\ryou have the following permissions:\r\n";
for my $r (sort keys %repos) {
my $perm .= ( $repos{$r}{C}{'@all'} ? ' @' : ( $repos{$r}{C}{$user} ? ' C' : ' ' ) );
diff -U3 -r sitaramc-gitolite-367e8f8.orig/src/gl-auth-command sitaramc-gitolite-367e8f8/src/gl-auth-command
--- sitaramc-gitolite-367e8f8.orig/src/gl-auth-command 2010-03-11 23:38:51.000000000 -0600
+++ sitaramc-gitolite-367e8f8/src/gl-auth-command 2010-03-25 06:41:17.307979546 -0500
@@ -33,7 +33,7 @@
my $bindir = $0;
$bindir =~ s/\/[^\/]+$//;
$bindir = "$ENV{PWD}/$bindir" unless $bindir =~ /^\//;
-require "$bindir/gitolite.pm";
+require gitolite;
# ask where the rc file is, get it, and "do" it
&where_is_rc();
@@ -178,7 +178,7 @@
# auto-vivify new repo if you have C access (and wildrepos is on)
if ( $GL_WILDREPOS and $repos{$repo}{C}{$user} || $repos{$repo}{C}{'@all'} ) {
wrap_chdir("$repo_base_abs");
- new_repo($repo, "$GL_ADMINDIR/hooks/common", $user);
+ new_repo($repo, "/usr/share/gitolite/hooks/common", $user);
wrap_chdir($ENV{HOME});
}
}
diff -U3 -r sitaramc-gitolite-367e8f8.orig/src/gl-compile-conf sitaramc-gitolite-367e8f8/src/gl-compile-conf
--- sitaramc-gitolite-367e8f8.orig/src/gl-compile-conf 2010-03-11 23:38:51.000000000 -0600
+++ sitaramc-gitolite-367e8f8/src/gl-compile-conf 2010-03-25 06:42:56.026974982 -0500
@@ -69,7 +69,7 @@
my $bindir = $0;
$bindir =~ s/\/[^\/]+$//;
$bindir = "$ENV{PWD}/$bindir" unless $bindir =~ /^\//;
-require "$bindir/gitolite.pm";
+require gitolite;
# ask where the rc file is, get it, and "do" it
&where_is_rc();
@@ -83,7 +83,7 @@
# ----------------------------------------------------------------------------
# command and options for authorized_keys
-$AUTH_COMMAND="$bindir/gl-auth-command";
+$AUTH_COMMAND="/usr/bin/gl-auth-command";
$AUTH_OPTIONS="no-port-forwarding,no-X11-forwarding,no-agent-forwarding";
# note, for most users there's also a "no-pty" added to this, see later
@@ -396,7 +396,7 @@
next if $repo =~ m(^EXTCMD/); # these are not real repos
unless (-d "$repo.git") {
print STDERR "creating $repo...\n";
- new_repo($repo, "$GL_ADMINDIR/hooks/common");
+ new_repo($repo, "/usr/share/gitolite/hooks/common");
# new_repo would have chdir'd us away; come back
wrap_chdir("$repo_base_abs");
}
diff -U3 -r sitaramc-gitolite-367e8f8.orig/src/gl-easy-install sitaramc-gitolite-367e8f8/src/gl-easy-install
--- sitaramc-gitolite-367e8f8.orig/src/gl-easy-install 2010-03-11 23:38:51.000000000 -0600
+++ sitaramc-gitolite-367e8f8/src/gl-easy-install 2010-03-25 06:52:07.613975915 -0500
@@ -48,7 +48,7 @@
[[ $upgrade == 0 ]] && initial_conf_key
# MANUAL: cd to $GL_ADMINDIR and run "src/gl-compile-conf"
- ssh -p $port $user@$host "cd $GL_ADMINDIR; \$PWD/src/gl-compile-conf $quiet"
+ ssh -p $port $user@$host "cd $GL_ADMINDIR; gl-compile-conf $quiet"
setup_pta
@@ -60,13 +60,12 @@
# ----------------------------------------------------------------------
setup_tempdir() {
- export tmpgli=tmp-gl-install
trap cleanup 0
- mkdir -p $tmpgli
+ export tmpgli=$(mktemp -d)
}
cleanup() {
- rm -rf $tmpgli
+ [ -d $tmpgli ] && rm -rf $tmpgli
}
# ----------------------------------------------------------------------
@@ -169,15 +168,15 @@
# MANUAL: make sure you're in the gitolite directory, at the top level.
# The following files should all be visible:
- ls hooks/gitolite-admin/post-update \
- hooks/common/update \
- src/gitolite.pm \
- src/gl-install \
- src/gl-auth-command \
- src/gl-compile-conf \
- conf/example.conf \
- conf/example.gitolite.rc >/dev/null ||
- die "cant find at least some files in gitolite sources/config; aborting"
+# ls hooks/gitolite-admin/post-update \
+# hooks/common/update \
+# src/gitolite.pm \
+# src/gl-install \
+# src/gl-auth-command \
+# src/gl-compile-conf \
+# conf/example.conf \
+# conf/example.gitolite.rc >/dev/null ||
+# die "cant find at least some files in gitolite sources/config; aborting"
# MANUAL: make sure you have password-less (pubkey) auth on the server.
# That is, running "ssh git@server" should log in straight away, without
@@ -195,13 +194,16 @@
# 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 > conf/VERSION || echo '(unknown)' > conf/VERSION
+ LOCAL=$(rpm -qf --qf '%{version}-%{release}' $0 2>/dev/null |
+ awk 'BEGIN {n="(unknown)"} {n=$0} END {print n}')
+ REMOTE=$(rpm -q --qf '%{version}-%{release}' gitolite) || FAIL=1
+
+ [ "$FAIL" ] && die "Could not determine version of gitolite installed on remote: $REMOTE"
+
# what was the old version there?
export upgrade_details="you are upgrading \
- $(ssh -p $port $user@$host cat gitolite-install/conf/VERSION 2>/dev/null || echo '(or installing first-time)' ) \
- to $(cat conf/VERSION)"
+ $REMOTE to $LOCAL"
prompt "$upgrade_details" "$v_upgrade_details"
}
@@ -281,8 +283,8 @@
# server, to a directory called (for example) "gitolite-install". You may
# have to create the directory first.
- ssh -p $port $user@$host mkdir -p gitolite-install
- scp $quiet -P $port -r src conf doc hooks $user@$host:gitolite-install/
+ #ssh -p $port $user@$host mkdir -p gitolite-install
+ #scp $quiet -P $port -r src conf doc hooks $user@$host:gitolite-install/
# 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
@@ -296,13 +298,14 @@
prompt "finding/creating gitolite rc..." "$v_edit_glrc"
# lets try and get the file from there first
+ scp -P $port $user@$host:/usr/share/gitolite/conf/example.gitolite.rc $tmpgli &>/dev/null
if scp -P $port $user@$host:.gitolite.rc $tmpgli &>/dev/null
then
prompt " ...trying to reuse existing rc" \
"Oh hey... you already had a '.gitolite.rc' file on the server.
Let's see if we can use that instead of the default one..."
< $tmpgli/.gitolite.rc perl -ne 'print "$1\n" if /^\s*(\$\w+) *=/' | sort > $tmpgli/glrc.old
- < conf/example.gitolite.rc perl -ne 'print "$1\n" if /^\s*(\$\w+) *=/' | sort > $tmpgli/glrc.new
+ < $tmpgli/example.gitolite.rc perl -ne 'print "$1\n" if /^\s*(\$\w+) *=/' | sort > $tmpgli/glrc.new
# msysgit doesn't have "comm". diff is not ideal for our purposes
# because we only care about differences in one direction, but we'll
# have to make do...
@@ -321,10 +324,10 @@
# customisations as well as any new variables that the new version of
# gitolite has introduced
prompt "" "$v_upgrade_glrc"
- ${VISUAL:-${EDITOR:-vi}} conf/example.gitolite.rc $tmpgli/.gitolite.rc
+ ${VISUAL:-${EDITOR:-vi}} $tmpgli/example.gitolite.rc $tmpgli/.gitolite.rc
fi
else
- cp conf/example.gitolite.rc $tmpgli/.gitolite.rc
+ cp $tmpgli/example.gitolite.rc $tmpgli/.gitolite.rc
[[ $quiet == -q ]] || ${VISUAL:-${EDITOR:-vi}} $tmpgli/.gitolite.rc
fi
@@ -358,7 +361,7 @@
# MANUAL: still in the "gitolite-install" directory? Good. Run
# "src/gl-install"
- ssh -p $port $user@$host "cd gitolite-install; src/gl-install $quiet"
+ ssh -p $port $user@$host "gl-install $quiet"
# MANUAL: if you're upgrading, run "src/gl-compile-conf" and you're done!
# -- ignore the rest of this file for the purposes of an upgrade
@@ -419,7 +422,7 @@
# properly. The install program does this. So cd back to the
# "gitolite-install" directory and run "src/gl-install"
- ssh -p $port $user@$host "cd gitolite-install; src/gl-install $quiet"
+ ssh -p $port $user@$host "gl-install $quiet"
# MANUAL: you're done! Log out of the server, come back to your
# workstation, and clone the admin repo using "git clone
@@ -454,11 +457,12 @@
v_upgrade_details="
\$upgrade_details
-Note: getting '(unknown)' for the 'from' version should only happen once.
-Getting '(unknown)' for the 'to' version means you are probably installing
-from a tar file dump, not a real clone. This is not an error but it's nice to
-have those version numbers in case you need support. Try and install from a
-clone
+Note: You should have same versions of gitolite RPM packages installed both
+on server and locally.
+
+Please report problems with RPM packaged version of gitolite to Bugzilla:
+https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora&component=gitolite
+
"
v_setting_up_keypair="
diff -U3 -r sitaramc-gitolite-367e8f8.orig/src/gl-install sitaramc-gitolite-367e8f8/src/gl-install
--- sitaramc-gitolite-367e8f8.orig/src/gl-install 2010-03-11 23:38:51.000000000 -0600
+++ sitaramc-gitolite-367e8f8/src/gl-install 2010-03-25 06:57:43.610978182 -0500
@@ -24,18 +24,14 @@
# the common setup module is in the same directory as this running program is
my $bindir = $0;
$bindir =~ s/\/[^\/]+$//;
-require "$bindir/gitolite.pm";
+require gitolite;
# ask where the rc file is, get it, and "do" it
&where_is_rc();
unless ($ENV{GL_RC}) {
# doesn't exist. Copy it across, tell user to edit it and come back
my $glrc = $ENV{HOME} . "/.gitolite.rc";
- if ($GL_PACKAGE_CONF) {
- system("cp $GL_PACKAGE_CONF/example.gitolite.rc $glrc");
- } else {
- system("cp $bindir/../conf/example.gitolite.rc $glrc");
- }
+ system("cp /usr/share/gitolite/conf/example.gitolite.rc $glrc");
print "created $glrc\n";
print "please edit it, change the paths if you wish to, and RERUN THIS SCRIPT\n";
exit;
@@ -52,18 +48,18 @@
wrap_mkdir($repo_base_abs);
wrap_mkdir($GL_ADMINDIR);
# mkdir $GL_ADMINDIR's subdirs
-for my $dir qw(conf doc keydir logs src hooks hooks/common hooks/gitolite-admin) {
+for my $dir qw(conf keydir logs hooks hooks/common hooks/gitolite-admin) {
# some of them will stay empty; too lazy to fix right now ;-)
wrap_mkdir("$GL_ADMINDIR/$dir");
}
# "src" and "doc" will be overwritten on each install, but not conf
-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");
-}
+#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) {
print <<EOF;
@@ -73,7 +69,7 @@
RW+ = yourname
2. copy "yourname.pub" to $GL_ADMINDIR/keydir
3. run this command
- $GL_ADMINDIR/src/gl-compile-conf
+ gl-compile-conf
EOF
}
@@ -82,7 +78,7 @@
for my $repo (`find . -type d -name "*.git"`) {
chomp ($repo);
# propagate our own, plus any local admin-defined, hooks
- ln_sf("$GL_ADMINDIR/hooks/common", "*", "$repo/hooks");
+ ln_sf("/usr/share/gitolite/hooks/common", "*", "$repo/hooks");
# in case of package install, GL_ADMINDIR is no longer the top cop;
# override with the package hooks
ln_sf("$GL_PACKAGE_HOOKS/common", "*", "$repo/hooks") if $GL_PACKAGE_HOOKS;
@@ -93,7 +89,7 @@
if ( -d "gitolite-admin.git/hooks" ) {
print "copying post-update hook to gitolite-admin repo...\n";
unlink "gitolite-admin.git/hooks/post-update";
- symlink "$GL_ADMINDIR/hooks/gitolite-admin/post-update", "gitolite-admin.git/hooks/post-update"
+ symlink "/usr/share/gitolite/hooks/gitolite-admin/post-update", "gitolite-admin.git/hooks/post-update"
or die "could not symlink post-update hook\n";
# ditto... (see previous block)
ln_sf("$GL_PACKAGE_HOOKS/gitolite-admin", "post-update", "gitolite-admin.git/hooks") if $GL_PACKAGE_HOOKS;
@@ -101,7 +97,7 @@
}
# 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 VERSION) {
- unlink "$GL_ADMINDIR/src/$oldname";
- unlink "$ENV{HOME}/gitolite-install/src/$oldname";
-}
+#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";
+#}
--- sitaramc-gitolite-367e8f8/src/gl-setup~ 2010-03-11 23:38:51.000000000 -0600
+++ sitaramc-gitolite-367e8f8/src/gl-setup 2010-03-25 08:04:59.015820946 -0500
@@ -1,6 +1,6 @@
#!/bin/sh
-GL_PACKAGE_CONF=/tmp/share/gitolite/conf
+GL_PACKAGE_CONF=/usr/share/gitolite/conf
# must be the same as the value for the same variable in
# $GL_PACKAGE_CONF/example.gitolite.rc. Sorry about the catch-22 :)
--- sitaramc-gitolite-367e8f8/hooks/common/update~ 2010-03-11 23:38:51.000000000 -0600
+++ sitaramc-gitolite-367e8f8/hooks/common/update 2010-03-25 10:56:24.976820449 -0500
@@ -48,7 +48,7 @@
# we've started to need some common subs in what used to be a small, cute,
# little script that barely spanned a few lines :(
-require "$ENV{GL_BINDIR}/gitolite.pm";
+require gitolite;
# ----------------------------------------------------------------------------
# start...