summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3c767a0)
raw | patch | inline | side by side (parent: 3c767a0)
author | Petr Baudis <pasky@suse.cz> | |
Mon, 3 Jul 2006 21:16:32 +0000 (23:16 +0200) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Tue, 4 Jul 2006 01:34:53 +0000 (18:34 -0700) |
This makes the Git perl scripts check $GITPERLLIB instead of
$RUNNING_GIT_TESTS, which makes more sense if you are setting up your shell
environment to use a non-installed Git instance.
It also weeds out the @INC munging from the individual scripts and makes
Makefile add it during the .perl files processing, so that we can change
just a single place when we modify this shared logic. It looks ugly in the
scripts, too. ;-)
And instead of doing arcane things with the @INC array, we just do 'use lib'
instead, which is essentialy the same thing anyway.
I first want to do three separate patches but it turned out that it's quite
a lot neater when bundled together, so I hope it's ok.
Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
$RUNNING_GIT_TESTS, which makes more sense if you are setting up your shell
environment to use a non-installed Git instance.
It also weeds out the @INC munging from the individual scripts and makes
Makefile add it during the .perl files processing, so that we can change
just a single place when we modify this shared logic. It looks ugly in the
scripts, too. ;-)
And instead of doing arcane things with the @INC array, we just do 'use lib'
instead, which is essentialy the same thing anyway.
I first want to do three separate patches but it turned out that it's quite
a lot neater when bundled together, so I hope it's ok.
Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
INSTALL | patch | blob | history | |
Makefile | patch | blob | history | |
git-fmt-merge-msg.perl | patch | blob | history | |
git-mv.perl | patch | blob | history | |
t/test-lib.sh | patch | blob | history |
index ed502de3d0ec743f0ed673ef34920de43f8dcdeb..4e8f8833848cd26c9adae3f8f130a1a8889a3e79 100644 (file)
--- a/INSTALL
+++ b/INSTALL
GIT_EXEC_PATH=`pwd`
PATH=`pwd`:$PATH
- PERL5LIB=`pwd`/perl/blib/lib:`pwd`/perl/blib/arch/auto/Git
- export GIT_EXEC_PATH PATH PERL5LIB
+ GITPERLLIB=`pwd`/perl/blib/lib:`pwd`/perl/blib/arch/auto/Git
+ export GIT_EXEC_PATH PATH GITPERLLIB
- Git is reasonably self-sufficient, but does depend on a few external
programs and libraries:
diff --git a/Makefile b/Makefile
index 703016725358c7122a211261eca946f17b31452f..71657ec90466766ed1035eea2e49b2ca05fd86dd 100644 (file)
--- a/Makefile
+++ b/Makefile
$(patsubst %.perl,%,$(SCRIPT_PERL)): % : %.perl
rm -f $@ $@+
INSTLIBDIR=`$(MAKE) -C perl -s --no-print-directory instlibdir` && \
- sed -e '1s|#!.*perl\(.*\)|#!$(PERL_PATH_SQ)\1|' \
+ sed -e '1s|#!.*perl|#!$(PERL_PATH_SQ)|1' \
+ -e '2i\
+ use lib (split(/:/, $$ENV{GITPERLLIB} || '\'"$$INSTLIBDIR"\''));' \
-e 's|@@INSTLIBDIR@@|'"$$INSTLIBDIR"'|g' \
-e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
$@.perl >$@+
diff --git a/git-fmt-merge-msg.perl b/git-fmt-merge-msg.perl
index a9805dd5119540df40cd08b27d9de35909e1fffc..f86231e14b0bf0d16ae3ac7978b824b3a994d359 100755 (executable)
--- a/git-fmt-merge-msg.perl
+++ b/git-fmt-merge-msg.perl
# Read .git/FETCH_HEAD and make a human readable merge message
# by grouping branches and tags together to form a single line.
-BEGIN {
- unless (exists $ENV{'RUNNING_GIT_TESTS'}) {
- unshift @INC, '@@INSTLIBDIR@@';
- }
-}
use strict;
use Git;
use Error qw(:try);
diff --git a/git-mv.perl b/git-mv.perl
index 5134b805a5f69afc127f9904161948773c5df41b..322b9fdcb36367934e5409f2f825d7d782787289 100755 (executable)
--- a/git-mv.perl
+++ b/git-mv.perl
# This file is licensed under the GPL v2, or a later version
# at the discretion of Linus Torvalds.
-BEGIN {
- unless (exists $ENV{'RUNNING_GIT_TESTS'}) {
- unshift @INC, '@@INSTLIBDIR@@';
- }
-}
use warnings;
use strict;
use Getopt::Std;
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 298c6caa7346ca394af997d0311bb6f0bd23e915..ad9796ee98315e4ffe9cdc0cba12ddf746a6a742 100755 (executable)
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
PYTHONPATH=$(pwd)/../compat
export PYTHONPATH
}
-RUNNING_GIT_TESTS=YesWeAre
-PERL5LIB=$(pwd)/../perl/blib/lib:$(pwd)/../perl/blib/arch/auto/Git
-export PERL5LIB RUNNING_GIT_TESTS
+GITPERLLIB=$(pwd)/../perl/blib/lib:$(pwd)/../perl/blib/arch/auto/Git
+export GITPERLLIB
test -d ../templates/blt || {
error "You haven't built things yet, have you?"
}