5 # Clearly you don't need a program to make one measly symlink, but the git
6 # describe command involved in generating the VERSION string is a bit fiddly.
11 # meant to be run from the root of the gitolite tree, one level above 'src'
12 BEGIN { $ENV{GL_BINDIR
} = $FindBin::RealBin
. "/src"; }
13 BEGIN { $ENV{GL_LIBDIR
} = "$ENV{GL_BINDIR}/lib"; }
14 use lib
$ENV{GL_LIBDIR
};
18 Usage (from gitolite clone directory):
21 to run gitolite using an absolute or relative path, for example
22 'src/gitolite' or '/full/path/to/this/dir/src/gitolite'
25 to symlink just the gitolite executable to some <dir> that is in
26 $PATH. <dir> defaults to $HOME/bin if <dir> not specified. <dir> is
27 assumed to exist; gitolite will not create it.
29 Please provide a full path, not a relative path.
32 to copy the entire 'src' directory to <dir>. If <dir> is not in
33 $PATH, use the full path to run gitolite commands.
35 Please provide a full path, not a relative path.
37 Simplest use, if $HOME/bin exists and is in $PATH, is:
39 git clone git://github.com/sitaramc/gitolite
43 gitolite setup -pk /path/to/YourName.pub
46 my ( $to, $ln, $help, $quiet );
54 usage
() if $to and $ln or $help;
55 $ln = "$ENV{HOME}/bin" if defined($ln) and not $ln;
56 for my $d ($ln, $to) {
57 if ($d and not -d
$d) {
58 print STDERR
"FATAL: '$d' does not exist.\n";
63 chdir($ENV{GL_BINDIR
});
64 my $version = `git describe --tags --long --dirty=-dt 2>/dev/null`;
65 unless ($version =~ /^v\d/) {
66 print STDERR
"git describe failed; cannot deduce version number\n";
67 $version = "(unknown)";
72 system("cp -RpP * $to");
73 _print
( "$to/VERSION", $version );
75 ln_sf
( $ENV{GL_BINDIR
}, "gitolite", $ln );
76 _print
( "VERSION", $version );
78 say "use the following full path for gitolite:";
79 say "\t$ENV{GL_BINDIR}/gitolite";
80 _print
( "VERSION", $version );