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 https://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 next unless $d; # ignore empty values
58 unless ( $d =~ m
(^/) ) {
59 print STDERR
"FATAL: please use an absolute path, not a relative path\n";
63 print STDERR
"FATAL: '$d' does not exist.\n";
68 chdir($ENV{GL_BINDIR
});
69 my $version = `git describe --tags --long --dirty=-dt 2>/dev/null`;
70 unless ($version =~ /^v\d/) {
71 print STDERR
"git describe failed; cannot deduce version number\n";
72 $version = "(unknown)";
77 system("cp -RpP * $to");
78 _print
( "$to/VERSION", $version );
80 ln_sf
( $ENV{GL_BINDIR
}, "gitolite", $ln );
81 _print
( "VERSION", $version );
83 say "use the following full path for gitolite:";
84 say "\t$ENV{GL_BINDIR}/gitolite";
85 _print
( "VERSION", $version );