* [PATCH] Fix compilation
@ 2006-07-06 23:21 Johannes Schindelin
2006-07-07 0:15 ` Junio C Hamano
2006-07-07 20:02 ` Junio C Hamano
0 siblings, 2 replies; 4+ messages in thread
From: Johannes Schindelin @ 2006-07-06 23:21 UTC (permalink / raw)
To: git, junkio
Without this, make 3.79.1 (Darwin) says
rm -f git-archimport git-archimport+
INSTLIBDIR=`make -C perl -s --no-print-directory instlibdir` && \
sed -e '1s|#!.*perl|#!/usr/bin/perl|1' \
-e '2i\
use lib (split(/:/, $ENV{GITPERLLIB} || '\'"$INSTLIBDIR"\''));' \
-e 's|@@INSTLIBDIR@@|'"$INSTLIBDIR"'|g' \
-e 's/@@GIT_VERSION@@/1.4.1.gb564-dirty/g' \
git-archimport.perl >git-archimport+
sed: 1: "2i use lib (split(/:/, ...": command i expects \ followed by text
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
---
Note that this just fixes compilation, not the tests. All of
a sudden, I have to install Scalar::Util, where things were
fine before Git.pm.
Note also, that this patch relies on the perl scripts not
caring if an additional command is shifted into the 2nd line.
I checked all of them, and they don't.
Makefile | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -563,8 +563,7 @@ common-cmds.h: Documentation/git-*.txt
rm -f $@ $@+
INSTLIBDIR=`$(MAKE) -C perl -s --no-print-directory instlibdir` && \
sed -e '1s|#!.*perl|#!$(PERL_PATH_SQ)|1' \
- -e '2i\
- use lib (split(/:/, $$ENV{GITPERLLIB} || '\'"$$INSTLIBDIR"\''));' \
+ -e "2s=^=use lib (split(/:/, \$$ENV{GITPERLLIB} || \'$$INSTLIBDIR\')); =g" \
-e 's|@@INSTLIBDIR@@|'"$$INSTLIBDIR"'|g' \
-e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
$@.perl >$@+
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] Fix compilation
2006-07-06 23:21 [PATCH] Fix compilation Johannes Schindelin
@ 2006-07-07 0:15 ` Junio C Hamano
2006-07-07 20:02 ` Junio C Hamano
1 sibling, 0 replies; 4+ messages in thread
From: Junio C Hamano @ 2006-07-07 0:15 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: git
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> Without this, make 3.79.1 (Darwin) says
>
> rm -f git-archimport git-archimport+
> INSTLIBDIR=`make -C perl -s --no-print-directory instlibdir` && \
> sed -e '1s|#!.*perl|#!/usr/bin/perl|1' \
> -e '2i\
> use lib (split(/:/, $ENV{GITPERLLIB} || '\'"$INSTLIBDIR"\''));' \
> -e 's|@@INSTLIBDIR@@|'"$INSTLIBDIR"'|g' \
> -e 's/@@GIT_VERSION@@/1.4.1.gb564-dirty/g' \
> git-archimport.perl >git-archimport+
> sed: 1: "2i use lib (split(/:/, ...": command i expects \ followed by text
>
> Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Traditionally 'i' and 'a' command to sed has been unfriendly
with make, primarily because different make implementations did
unexpected things to backslashes at the end of lines.
For portability I would even suggest making that command into a
separate helper shell script, and call that from the Makefile.
> Note that this just fixes compilation, not the tests. All of
> a sudden, I have to install Scalar::Util, where things were
> fine before Git.pm.
I recall Pasky talking about Scalar::Util removal and I thought
I took a patch.
... goes "git grep" ...
Ah the private edition of Error.pm pulls that in. Sheesh.
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] Fix compilation
2006-07-06 23:21 [PATCH] Fix compilation Johannes Schindelin
2006-07-07 0:15 ` Junio C Hamano
@ 2006-07-07 20:02 ` Junio C Hamano
2006-07-08 2:04 ` Johannes Schindelin
1 sibling, 1 reply; 4+ messages in thread
From: Junio C Hamano @ 2006-07-07 20:02 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: git, junkio
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> Note also, that this patch relies on the perl scripts not
> caring if an additional command is shifted into the 2nd line.
How about doing something like this instead, then?
diff --git a/Makefile b/Makefile
index 71657ec..01b9a94 100644
--- a/Makefile
+++ b/Makefile
@@ -550,9 +550,13 @@ common-cmds.h: Documentation/git-*.txt
$(patsubst %.perl,%,$(SCRIPT_PERL)): % : %.perl
rm -f $@ $@+
INSTLIBDIR=`$(MAKE) -C perl -s --no-print-directory instlibdir` && \
- sed -e '1s|#!.*perl|#!$(PERL_PATH_SQ)|1' \
- -e '2i\
- use lib (split(/:/, $$ENV{GITPERLLIB} || '\'"$$INSTLIBDIR"\''));' \
+ sed -e '1{' \
+ -e ' s|#!.*perl|#!$(PERL_PATH_SQ)|' \
+ -e ' h' \
+ -e ' s=.*=use lib (split(/:/, $$ENV{GITPERLLIB} || "@@INSTLIBDIR@@"));=' \
+ -e ' H' \
+ -e ' x' \
+ -e '}' \
-e 's|@@INSTLIBDIR@@|'"$$INSTLIBDIR"'|g' \
-e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
$@.perl >$@+
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] Fix compilation
2006-07-07 20:02 ` Junio C Hamano
@ 2006-07-08 2:04 ` Johannes Schindelin
0 siblings, 0 replies; 4+ messages in thread
From: Johannes Schindelin @ 2006-07-08 2:04 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
Hi,
On Fri, 7 Jul 2006, Junio C Hamano wrote:
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>
> > Note also, that this patch relies on the perl scripts not
> > caring if an additional command is shifted into the 2nd line.
>
> How about doing something like this instead, then?
I will try as soon as possible. ATM my iBook is in my car, which I had to
leave at a friend's place, because said friend sensibly refused to let me
drive.
Ciao,
Dscho
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2006-07-08 2:04 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-06 23:21 [PATCH] Fix compilation Johannes Schindelin
2006-07-07 0:15 ` Junio C Hamano
2006-07-07 20:02 ` Junio C Hamano
2006-07-08 2:04 ` Johannes Schindelin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox