{"thread":{"id":"14051","subject":"[PATCH] gitweb: respect $GITPERLLIB","startedAt":"2008-06-20T02:31:57Z","lastAt":"2008-06-21T22:40:38Z","messageCount":5,"participants":["Lea Wiemann","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"80426","messageId":"1213929117-32037-1-git-send-email-LeWiemann@gmail.com","threadId":"14051","inReplyTo":null,"subject":"[PATCH] gitweb: respect $GITPERLLIB","fromName":"Lea Wiemann","fromEmail":"lewiemann@gmail.com","sentAt":"2008-06-20T02:31:57Z","receivedAt":"2008-06-20T02:31:57Z","isPatch":true,"sender":{"key":"lewiemann@gmail.com","avatar":null},"body":"gitweb/gitweb.cgi now respects $GITPERLLIB, like the Perl-based Git\ncommands.\n\nSigned-off-by: Lea Wiemann <LeWiemann@gmail.com>\n---\nJunio C Hamano wrote in <http://mid.gmane.org/7vfxrwa008.fsf@gitster.siamese.dyndns.org>:\n> The real fix to the issue [is] to fix the build\n> procedure of gitweb/gitweb.perl so that the above script rewriting is also\n> applied to it.\n\nI've now implemented this, since it's becoming necessary for the\nMechanize tests.  However, I'm not totally confident that what I wrote\nis (a) correct and (b) a good idea -- I simply copy-and-pasted from\nthe previous Makefile entry, since I'm not very proficient with sed.\n\nComments appreciated!\n\n-- Lea\n\n Makefile |    9 ++++++++-\n 1 files changed, 8 insertions(+), 1 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex b003e3e..c5c6ac7 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -1081,7 +1081,14 @@ $(patsubst %.perl,%,$(SCRIPT_PERL)): % : %.perl\n \n gitweb/gitweb.cgi: gitweb/gitweb.perl\n \t$(QUIET_GEN)$(RM) $@ $@+ && \\\n-\tsed -e '1s|#!.*perl|#!$(PERL_PATH_SQ)|' \\\n+\tsed -e '1{' \\\n+\t    -e '\ts|#!.*perl|#!$(PERL_PATH_SQ)|' \\\n+\t    -e '\th' \\\n+\t    -e '\ts=.*=use lib (split(/:/, $$ENV{GITPERLLIB} || \"@@INSTLIBDIR@@\"));=' \\\n+\t    -e '\tH' \\\n+\t    -e '\tx' \\\n+\t    -e '}' \\\n+\t    -e 's|@@INSTLIBDIR@@|'\"$$INSTLIBDIR\"'|g' \\\n \t    -e 's|++GIT_VERSION++|$(GIT_VERSION)|g' \\\n \t    -e 's|++GIT_BINDIR++|$(bindir)|g' \\\n \t    -e 's|++GITWEB_CONFIG++|$(GITWEB_CONFIG)|g' \\\n-- \n1.5.6.31.gcbcff.dirty\n"},{"id":"80514","messageId":"1213990547-7585-1-git-send-email-LeWiemann@gmail.com","threadId":"14051","inReplyTo":"1213929117-32037-1-git-send-email-LeWiemann@gmail.com","subject":"[RFC/PATCH v2] gitweb: respect $GITPERLLIB","fromName":"Lea Wiemann","fromEmail":"lewiemann@gmail.com","sentAt":"2008-06-20T19:35:46Z","receivedAt":"2008-06-20T19:35:46Z","isPatch":true,"sender":{"key":"lewiemann@gmail.com","avatar":null},"body":"gitweb/gitweb.cgi now respects $GITPERLLIB, like the Perl-based Git\ncommands.\n\nSigned-off-by: Lea Wiemann <LeWiemann@gmail.com>\n---\nChanged since v1: Added missing INSTLIBDIR initialization.\n\nI just noticed that as of now Gitweb isn't using any Perl modules, so\nthis change is actually not necessary yet; hence I'm making it an RFC\npatch.  I'll probably squash this into a larger \"gitweb: use new\nGit::Repo API\" patch (which I'll publish in a few days).\n\nComments on this change to the Makefile are still appreciated, of\ncourse. :)\n\n-- Lea\n\n Makefile |   10 +++++++++-\n 1 files changed, 9 insertions(+), 1 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 85c0846..64eeac1 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -1083,7 +1083,15 @@ $(patsubst %.perl,%,$(SCRIPT_PERL)): % : %.perl\n \n gitweb/gitweb.cgi: gitweb/gitweb.perl\n \t$(QUIET_GEN)$(RM) $@ $@+ && \\\n-\tsed -e '1s|#!.*perl|#!$(PERL_PATH_SQ)|' \\\n+\tINSTLIBDIR=`MAKEFLAGS= $(MAKE) -C perl -s --no-print-directory instlibdir` && \\\n+\tsed -e '1{' \\\n+\t    -e '\ts|#!.*perl|#!$(PERL_PATH_SQ)|' \\\n+\t    -e '\th' \\\n+\t    -e '\ts=.*=use lib (split(/:/, $$ENV{GITPERLLIB} || \"@@INSTLIBDIR@@\"));=' \\\n+\t    -e '\tH' \\\n+\t    -e '\tx' \\\n+\t    -e '}' \\\n+\t    -e 's|@@INSTLIBDIR@@|'\"$$INSTLIBDIR\"'|g' \\\n \t    -e 's|++GIT_VERSION++|$(GIT_VERSION)|g' \\\n \t    -e 's|++GIT_BINDIR++|$(bindir)|g' \\\n \t    -e 's|++GITWEB_CONFIG++|$(GITWEB_CONFIG)|g' \\\n-- \n1.5.6.79.g01e9.dirty\n"},{"id":"80515","messageId":"1213990547-7585-2-git-send-email-LeWiemann@gmail.com","threadId":"14051","inReplyTo":"1213990547-7585-1-git-send-email-LeWiemann@gmail.com","subject":"[RFC/PATCH v2] gitweb: respect $GITPERLLIB","fromName":"Lea Wiemann","fromEmail":"lewiemann@gmail.com","sentAt":"2008-06-20T19:35:47Z","receivedAt":"2008-06-20T19:35:47Z","isPatch":true,"sender":{"key":"lewiemann@gmail.com","avatar":null},"body":"gitweb/gitweb.cgi now respects $GITPERLLIB, like the Perl-based Git\ncommands.\n\nSigned-off-by: Lea Wiemann <LeWiemann@gmail.com>\n---\nChanged since v1: Added missing INSTLIBDIR initialization.\n\nI just noticed that as of now Gitweb isn't using any Perl modules, so\nthis change is actually not necessary yet; hence I'm making it an RFC\npatch.  I'll probably squash this into a larger \"gitweb: use new\nGit::Repo API\" patch (which I'll publish in a few days).\n\nComments on this change to the Makefile are still appreciated, of\ncourse. :)\n\n-- Lea\n\n Makefile |   10 +++++++++-\n 1 files changed, 9 insertions(+), 1 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 85c0846..64eeac1 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -1083,7 +1083,15 @@ $(patsubst %.perl,%,$(SCRIPT_PERL)): % : %.perl\n \n gitweb/gitweb.cgi: gitweb/gitweb.perl\n \t$(QUIET_GEN)$(RM) $@ $@+ && \\\n-\tsed -e '1s|#!.*perl|#!$(PERL_PATH_SQ)|' \\\n+\tINSTLIBDIR=`MAKEFLAGS= $(MAKE) -C perl -s --no-print-directory instlibdir` && \\\n+\tsed -e '1{' \\\n+\t    -e '\ts|#!.*perl|#!$(PERL_PATH_SQ)|' \\\n+\t    -e '\th' \\\n+\t    -e '\ts=.*=use lib (split(/:/, $$ENV{GITPERLLIB} || \"@@INSTLIBDIR@@\"));=' \\\n+\t    -e '\tH' \\\n+\t    -e '\tx' \\\n+\t    -e '}' \\\n+\t    -e 's|@@INSTLIBDIR@@|'\"$$INSTLIBDIR\"'|g' \\\n \t    -e 's|++GIT_VERSION++|$(GIT_VERSION)|g' \\\n \t    -e 's|++GIT_BINDIR++|$(bindir)|g' \\\n \t    -e 's|++GITWEB_CONFIG++|$(GITWEB_CONFIG)|g' \\\n-- \n1.5.6.79.g01e9.dirty\n"},{"id":"80539","messageId":"7vabhfazok.fsf@gitster.siamese.dyndns.org","threadId":"14051","inReplyTo":"1213990547-7585-2-git-send-email-LeWiemann@gmail.com","subject":"Re: [RFC/PATCH v2] gitweb: respect $GITPERLLIB","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-06-21T09:46:03Z","receivedAt":"2008-06-21T09:46:03Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Lea Wiemann <lewiemann@gmail.com> writes:\n\n> gitweb/gitweb.cgi now respects $GITPERLLIB, like the Perl-based Git\n> commands.\n>\n> Signed-off-by: Lea Wiemann <LeWiemann@gmail.com>\n> ---\n> Changed since v1: Added missing INSTLIBDIR initialization.\n>\n> I just noticed that as of now Gitweb isn't using any Perl modules, so\n> this change is actually not necessary yet; hence I'm making it an RFC\n> patch.  I'll probably squash this into a larger \"gitweb: use new\n> Git::Repo API\" patch (which I'll publish in a few days).\n>\n> Comments on this change to the Makefile are still appreciated, of\n> course. :)\n>\n> -- Lea\n>\n>  Makefile |   10 +++++++++-\n>  1 files changed, 9 insertions(+), 1 deletions(-)\n>\n> diff --git a/Makefile b/Makefile\n> index 85c0846..64eeac1 100644\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -1083,7 +1083,15 @@ $(patsubst %.perl,%,$(SCRIPT_PERL)): % : %.perl\n>  \n>  gitweb/gitweb.cgi: gitweb/gitweb.perl\n>  \t$(QUIET_GEN)$(RM) $@ $@+ && \\\n> -\tsed -e '1s|#!.*perl|#!$(PERL_PATH_SQ)|' \\\n> +\tINSTLIBDIR=`MAKEFLAGS= $(MAKE) -C perl -s --no-print-directory instlibdir` && \\\n> +\tsed -e '1{' \\\n> +\t    -e '\ts|#!.*perl|#!$(PERL_PATH_SQ)|' \\\n> +\t    -e '\th' \\\n> +\t    -e '\ts=.*=use lib (split(/:/, $$ENV{GITPERLLIB} || \"@@INSTLIBDIR@@\"));=' \\\n> +\t    -e '\tH' \\\n> +\t    -e '\tx' \\\n> +\t    -e '}' \\\n> +\t    -e 's|@@INSTLIBDIR@@|'\"$$INSTLIBDIR\"'|g' \\\n>  \t    -e 's|++GIT_VERSION++|$(GIT_VERSION)|g' \\\n>  \t    -e 's|++GIT_BINDIR++|$(bindir)|g' \\\n>  \t    -e 's|++GITWEB_CONFIG++|$(GITWEB_CONFIG)|g' \\\n\nThis part seems to duplicate quite a bit of sed insn used elsewhere, and\nwe may want to factor the common part out, perhaps like this...\n\n Makefile |   25 ++++++++++++++-----------\n 1 files changed, 14 insertions(+), 11 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 6a31c9f..d3f1bde 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -1063,25 +1063,28 @@ $(patsubst %.perl,%,$(SCRIPT_PERL)): perl/perl.mak\n perl/perl.mak: GIT-CFLAGS perl/Makefile perl/Makefile.PL\n \t$(QUIET_SUBDIR0)perl $(QUIET_SUBDIR1) PERL_PATH='$(PERL_PATH_SQ)' prefix='$(prefix_SQ)' $(@F)\n \n+PERL_USE_LIB_REWRITE = \\\n+\t-e '1{' \\\n+\t-e '\ts|#!.*perl|#!$(PERL_PATH_SQ)|' \\\n+\t-e '\th' \\\n+\t-e '\ts=.*=use lib (split(/:/, $$ENV{GITPERLLIB} || \"@@INSTLIBDIR@@\"));=' \\\n+\t-e '\tH' \\\n+\t-e '\tx' \\\n+\t-e '}' \\\n+\t-e 's|@@INSTLIBDIR@@|'\"$$INSTLIBDIR\"'|g' \\\n+\t-e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g'\n+\n $(patsubst %.perl,%,$(SCRIPT_PERL)): % : %.perl\n \t$(QUIET_GEN)$(RM) $@ $@+ && \\\n \tINSTLIBDIR=`MAKEFLAGS= $(MAKE) -C perl -s --no-print-directory instlibdir` && \\\n-\tsed -e '1{' \\\n-\t    -e '\ts|#!.*perl|#!$(PERL_PATH_SQ)|' \\\n-\t    -e '\th' \\\n-\t    -e '\ts=.*=use lib (split(/:/, $$ENV{GITPERLLIB} || \"@@INSTLIBDIR@@\"));=' \\\n-\t    -e '\tH' \\\n-\t    -e '\tx' \\\n-\t    -e '}' \\\n-\t    -e 's|@@INSTLIBDIR@@|'\"$$INSTLIBDIR\"'|g' \\\n-\t    -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \\\n-\t    $@.perl >$@+ && \\\n+\tsed $(PERL_USE_LIB_REWRITE) $@.perl >$@+ && \\\n \tchmod +x $@+ && \\\n \tmv $@+ $@\n \n gitweb/gitweb.cgi: gitweb/gitweb.perl\n \t$(QUIET_GEN)$(RM) $@ $@+ && \\\n-\tsed -e '1s|#!.*perl|#!$(PERL_PATH_SQ)|' \\\n+\tINSTLIBDIR=`MAKEFLAGS= $(MAKE) -C perl -s --no-print-directory instlibdir` && \\\n+\tsed $(PERL_USE_LIB_REWRITE) \\\n \t    -e 's|++GIT_VERSION++|$(GIT_VERSION)|g' \\\n \t    -e 's|++GIT_BINDIR++|$(bindir)|g' \\\n \t    -e 's|++GITWEB_CONFIG++|$(GITWEB_CONFIG)|g' \\\n"},{"id":"80577","messageId":"1214088038-8408-1-git-send-email-LeWiemann@gmail.com","threadId":"14051","inReplyTo":"7vabhfazok.fsf@gitster.siamese.dyndns.org","subject":"[RFC/PATCH v3] gitweb: respect $GITPERLLIB","fromName":"Lea Wiemann","fromEmail":"lewiemann@gmail.com","sentAt":"2008-06-21T22:40:38Z","receivedAt":"2008-06-21T22:40:38Z","isPatch":true,"sender":{"key":"lewiemann@gmail.com","avatar":null},"body":"gitweb/gitweb.cgi now respects $GITPERLLIB, like the Perl-based Git\ncommands.\n\nThis patch is not for inclusion, it'll be squashed with a larger\ncommit.\n---\nJunio C Hamano wrote:\n> This part seems to duplicate quite a bit of sed insn used elsewhere, and\n> we may want to factor the common part out, perhaps like this...\n\nThanks!  This needs some tender loving quoting though; diff to your\nversion:\n\n   diff --git a/Makefile b/Makefile\n   index e6fd8ac..92a802f 100644\n   --- a/Makefile\n   +++ b/Makefile\n   @@ -1065,13 +1065,13 @@ $(patsubst %.perl,%,$(SCRIPT_PERL)): perl/perl.mak\n    perl/perl.mak: GIT-CFLAGS perl/Makefile perl/Makefile.PL\n    \t$(QUIET_SUBDIR0)perl $(QUIET_SUBDIR1) PERL_PATH='$(PERL_PATH_SQ)' prefix='$(prefix_SQ)' $(@F)\n \n    PERL_USE_LIB_REWRITE = \\\n    \t-e '1{' \\\n   -\t-e '\ts|#!.*perl|#!$(PERL_PATH_SQ)|' \\\n   +\t-e '\ts|\\#!.*perl|\\#!$(PERL_PATH_SQ)|' \\\n    \t-e '\th' \\\n   -\t-e '\ts=.*=use lib (split(/:/, $$ENV{GITPERLLIB} || \"@@INSTLIBDIR@@\"));=' \\\n   +\t-e '\ts=.*=use lib (split(/:/, \\$$ENV{GITPERLLIB} || \\\"@@INSTLIBDIR@@\\\"));=' \\\n    \t-e '\tH' \\\n    \t-e '\tx' \\\n    \t-e '}' \\\n    \t-e 's|@@INSTLIBDIR@@|'\"$$INSTLIBDIR\"'|g' \\\n    \t-e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g'\n\nI wonder though if that's too brittle or unmaintainable and we should\nrather use the explicit version in v2 (even if it duplicated code);\nI'd prefer v2 off the top of my head.\n\nAlso, note that I really only did trial-and-error quoting here. ;-)\n\n-- Lea\n\n Makefile |   25 ++++++++++++++-----------\n 1 files changed, 14 insertions(+), 11 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex fda9133..92a802f 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -1065,25 +1065,28 @@ $(patsubst %.perl,%,$(SCRIPT_PERL)): perl/perl.mak\n perl/perl.mak: GIT-CFLAGS perl/Makefile perl/Makefile.PL\n \t$(QUIET_SUBDIR0)perl $(QUIET_SUBDIR1) PERL_PATH='$(PERL_PATH_SQ)' prefix='$(prefix_SQ)' $(@F)\n \n+PERL_USE_LIB_REWRITE = \\\n+\t-e '1{' \\\n+\t-e '\ts|\\#!.*perl|\\#!$(PERL_PATH_SQ)|' \\\n+\t-e '\th' \\\n+\t-e '\ts=.*=use lib (split(/:/, \\$$ENV{GITPERLLIB} || \\\"@@INSTLIBDIR@@\\\"));=' \\\n+\t-e '\tH' \\\n+\t-e '\tx' \\\n+\t-e '}' \\\n+\t-e 's|@@INSTLIBDIR@@|'\"$$INSTLIBDIR\"'|g' \\\n+\t-e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g'\n+\n $(patsubst %.perl,%,$(SCRIPT_PERL)): % : %.perl\n \t$(QUIET_GEN)$(RM) $@ $@+ && \\\n \tINSTLIBDIR=`MAKEFLAGS= $(MAKE) -C perl -s --no-print-directory instlibdir` && \\\n-\tsed -e '1{' \\\n-\t    -e '\ts|#!.*perl|#!$(PERL_PATH_SQ)|' \\\n-\t    -e '\th' \\\n-\t    -e '\ts=.*=use lib (split(/:/, $$ENV{GITPERLLIB} || \"@@INSTLIBDIR@@\"));=' \\\n-\t    -e '\tH' \\\n-\t    -e '\tx' \\\n-\t    -e '}' \\\n-\t    -e 's|@@INSTLIBDIR@@|'\"$$INSTLIBDIR\"'|g' \\\n-\t    -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \\\n-\t    $@.perl >$@+ && \\\n+\tsed $(PERL_USE_LIB_REWRITE) $@.perl >$@+ && \\\n \tchmod +x $@+ && \\\n \tmv $@+ $@\n \n gitweb/gitweb.cgi: gitweb/gitweb.perl\n \t$(QUIET_GEN)$(RM) $@ $@+ && \\\n-\tsed -e '1s|#!.*perl|#!$(PERL_PATH_SQ)|' \\\n+\tINSTLIBDIR=`MAKEFLAGS= $(MAKE) -C perl -s --no-print-directory instlibdir` && \\\n+\tsed $(PERL_USE_LIB_REWRITE) \\\n \t    -e 's|++GIT_VERSION++|$(GIT_VERSION)|g' \\\n \t    -e 's|++GIT_BINDIR++|$(bindir)|g' \\\n \t    -e 's|++GITWEB_CONFIG++|$(GITWEB_CONFIG)|g' \\\n-- \n1.5.6.85.g0a2e.dirty\n"}]}