aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorPetr Baudis <pasky@suse.cz>2006-07-03 23:16:32 +0200
committerJunio C Hamano <junkio@cox.net>2006-07-03 18:34:53 -0700
commit6fcca938b05c33bcd8b502d6b6f178e377609fa3 (patch)
tree22287b26b74603cc780beca14a687be60f7f0f5c /Makefile
parent3c767a08243244b18d48315f8433ba07e435f654 (diff)
downloadgit-6fcca938b05c33bcd8b502d6b6f178e377609fa3.tar.gz
git-6fcca938b05c33bcd8b502d6b6f178e377609fa3.tar.xz
Use $GITPERLLIB instead of $RUNNING_GIT_TESTS and centralize @INC munging
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>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile4
1 files changed, 3 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 703016725..71657ec90 100644
--- a/Makefile
+++ b/Makefile
@@ -550,7 +550,9 @@ $(patsubst %.perl,%,$(SCRIPT_PERL)): perl/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 >$@+