{"thread":{"id":"14850","subject":"[PATCH] perl/Makefile: handle paths with spaces in the NO_PERL_MAKEMAKER section","startedAt":"2008-08-05T23:23:08Z","lastAt":"2008-08-07T00:23:14Z","messageCount":10,"participants":["Brandon Casey","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"86302","messageId":"osgPH47FO7h-zLUMqwCv-i9BWln2-_AK5T6TI-5mLGFjwAhJ4Bg_lw@cipher.nrlssc.navy.mil","threadId":"14850","inReplyTo":"mLu74vNKfH1vFZlC7N_lRX3WekWReoVjWY42voUDUBUnAGVpDNYWndWqlaHoqVAkxOaCdYV6uDk@cipher.nrlssc.navy.mil","subject":"[PATCH] perl/Makefile: handle paths with spaces in the NO_PERL_MAKEMAKER section","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2008-08-05T23:23:08Z","receivedAt":"2008-08-05T23:23:08Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"Use double quotes to protect against paths which may contain spaces.\n\nSigned-off-by: Brandon Casey <casey@nrlssc.navy.mil>\n---\n perl/Makefile |    8 ++++----\n 1 files changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/perl/Makefile b/perl/Makefile\nindex b8547db..e3dd1a5 100644\n--- a/perl/Makefile\n+++ b/perl/Makefile\n@@ -29,11 +29,11 @@ $(makfile): ../GIT-CFLAGS Makefile\n \t'$(PERL_PATH_SQ)' -MError -e 'exit($$Error::VERSION < 0.15009)' || \\\n \techo '\tcp private-Error.pm blib/lib/Error.pm' >> $@\n \techo install: >> $@\n-\techo '\tmkdir -p $(instdir_SQ)' >> $@\n-\techo '\t$(RM) $(instdir_SQ)/Git.pm; cp Git.pm $(instdir_SQ)' >> $@\n-\techo '\t$(RM) $(instdir_SQ)/Error.pm' >> $@\n+\techo '\tmkdir -p \"$(instdir_SQ)\"' >> $@\n+\techo '\t$(RM) \"$(instdir_SQ)/Git.pm\"; cp Git.pm \"$(instdir_SQ)\"' >> $@\n+\techo '\t$(RM) \"$(instdir_SQ)/Error.pm\"' >> $@\n \t'$(PERL_PATH_SQ)' -MError -e 'exit($$Error::VERSION < 0.15009)' || \\\n-\techo '\tcp private-Error.pm $(instdir_SQ)/Error.pm' >> $@\n+\techo '\tcp private-Error.pm \"$(instdir_SQ)/Error.pm\"' >> $@\n \techo instlibdir: >> $@\n \techo '\techo $(instdir_SQ)' >> $@\n else\n-- \n1.6.0.rc1.87.g56c9f.dirty\n"},{"id":"86303","messageId":"7v8wvbuit7.fsf@gitster.siamese.dyndns.org","threadId":"14850","inReplyTo":"osgPH47FO7h-zLUMqwCv-i9BWln2-_AK5T6TI-5mLGFjwAhJ4Bg_lw@cipher.nrlssc.navy.mil","subject":"Re: [PATCH] perl/Makefile: handle paths with spaces in the NO_PERL_MAKEMAKER section","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-08-05T23:46:12Z","receivedAt":"2008-08-05T23:46:12Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Brandon Casey <casey@nrlssc.navy.mil> writes:\n\n> Use double quotes to protect against paths which may contain spaces.\n> ...\n> +\techo '\tmkdir -p \"$(instdir_SQ)\"' >> $@\n\nIs this sufficient?  We seem to apply double-sq when writing shell\nscriptlet in GIT-BUILD-OPTIONS from the main Makefile, and I suspect you\nwould need to do something similar.\n"},{"id":"86347","messageId":"klGWkbWGpsUHZpuNwl9WvZs5UGGfYVAngWbiM3eippaejrXLNyLpRA@cipher.nrlssc.navy.mil","threadId":"14850","inReplyTo":"7v8wvbuit7.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] perl/Makefile: handle paths with spaces in the NO_PERL_MAKEMAKER section","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2008-08-06T14:25:18Z","receivedAt":"2008-08-06T14:25:18Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"Junio C Hamano wrote:\n> Brandon Casey <casey@nrlssc.navy.mil> writes:\n> \n>> Use double quotes to protect against paths which may contain spaces.\n>> ...\n>> +\techo '\tmkdir -p \"$(instdir_SQ)\"' >> $@\n> \n> Is this sufficient?  We seem to apply double-sq when writing shell\n> scriptlet in GIT-BUILD-OPTIONS from the main Makefile, and I suspect you\n> would need to do something similar.\n\nIt seems to be sufficient. The double quotes survived into my perl.mak file\nand the two perl modules were installed correctly when I supplied a prefix\nwith spaces. Is there something else to be concerned about?\n\nperl.mak:\nall: private-Error.pm Git.pm\n        mkdir -p blib/lib\n        rm -f blib/lib/Git.pm; cp Git.pm blib/lib/\n        rm -f blib/lib/Error.pm\n        cp private-Error.pm blib/lib/Error.pm\ninstall:\n        mkdir -p \"/home/casey/opt/SunOS spaces/sun4u/lib\"\n        rm -f \"/home/casey/opt/SunOS spaces/sun4u/lib/Git.pm\"; cp Git.pm \"/home/casey/opt/SunOS spaces/sun4u/lib\"\n        rm -f \"/home/casey/opt/SunOS spaces/sun4u/lib/Error.pm\"\n        cp private-Error.pm \"/home/casey/opt/SunOS spaces/sun4u/lib/Error.pm\"\ninstlibdir:\n        echo /home/casey/opt/SunOS spaces/sun4u/lib\n\n-brandon\n"},{"id":"86352","messageId":"7v7iaurwe4.fsf@gitster.siamese.dyndns.org","threadId":"14850","inReplyTo":"klGWkbWGpsUHZpuNwl9WvZs5UGGfYVAngWbiM3eippaejrXLNyLpRA@cipher.nrlssc.navy.mil","subject":"Re: [PATCH] perl/Makefile: handle paths with spaces in the NO_PERL_MAKEMAKER section","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-08-06T15:33:23Z","receivedAt":"2008-08-06T15:33:23Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Brandon Casey <casey@nrlssc.navy.mil> writes:\n\n> Junio C Hamano wrote:\n>> Brandon Casey <casey@nrlssc.navy.mil> writes:\n>> \n>>> Use double quotes to protect against paths which may contain spaces.\n>>> ...\n>>> +\techo '\tmkdir -p \"$(instdir_SQ)\"' >> $@\n>> \n>> Is this sufficient?  We seem to apply double-sq when writing shell\n>> scriptlet in GIT-BUILD-OPTIONS from the main Makefile, and I suspect you\n>> would need to do something similar.\n>\n> It seems to be sufficient. The double quotes survived into my perl.mak file\n> and the two perl modules were installed correctly when I supplied a prefix\n> with spaces. Is there something else to be concerned about?\n\nI think the generic way GIT-BUILD-OPTIONS writing is done covers cases\nwhere the installation directory has funnies other than whitespace, e.g. \ndouble quotes.  Is your 'echo \"$(instdir_SQ)\"' sufficient?\n"},{"id":"86365","messageId":"lh6XIUcjpbjj8G8Ot7RQFlDitUn1njsc350QhnNmQkcgxlfluBPGZw@cipher.nrlssc.navy.mil","threadId":"14850","inReplyTo":"7v7iaurwe4.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] perl/Makefile: handle paths with spaces in the NO_PERL_MAKEMAKER section","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2008-08-06T19:31:49Z","receivedAt":"2008-08-06T19:31:49Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"Junio C Hamano wrote:\n> Brandon Casey <casey@nrlssc.navy.mil> writes:\n> \n>> Junio C Hamano wrote:\n>>> Brandon Casey <casey@nrlssc.navy.mil> writes:\n>>>\n>>>> Use double quotes to protect against paths which may contain spaces.\n>>>> ...\n>>>> +\techo '\tmkdir -p \"$(instdir_SQ)\"' >> $@\n>>> Is this sufficient?  We seem to apply double-sq when writing shell\n>>> scriptlet in GIT-BUILD-OPTIONS from the main Makefile, and I suspect you\n>>> would need to do something similar.\n>> It seems to be sufficient. The double quotes survived into my perl.mak file\n>> and the two perl modules were installed correctly when I supplied a prefix\n>> with spaces. Is there something else to be concerned about?\n> \n> I think the generic way GIT-BUILD-OPTIONS writing is done covers cases\n> where the installation directory has funnies other than whitespace, e.g. \n> double quotes.  Is your 'echo \"$(instdir_SQ)\"' sufficient?\n\n\nDOUBLE QUOTE ISSUE:\n\nI added a double quote to my prefix, and the build fails at compiling config.c\nline 589. The failure is caused by the macro ETC_GITCONFIG which is set in the\nMakefile and contains the prefix string, which contains the single double quote.\nThis of course causes a syntax error. So it looks like the cleansing done to\nETC_GITCONFIG doesn't handle this.\n\nDoing this allows me to compile:\n\n    ETC_GITCONFIG_SQ = $(subst \",\\\",$(subst ','\\'',$(ETC_GITCONFIG)))\n\nThe patch at the end of this email applies the same treatment to the other\nvariables I needed to get git to compile. If this is the correct fix, then\nthe other variables used as macros in git source files would need to be\nhunted down... at least SHA1_HEADER_SQ, but maybe others?\n\n\nSPACE ISSUE:\n\nAlso, the installation of the perl modules fails when I have a space in the\npath and NO_PERL_MAKEMAKER is _not_ set. IOW the perl makemaker install fails\nfor me when there is a space in the path. This has nothing to do with the\ndouble quote I was talking about above, I think it would fail with double quote\ntoo.\n\nThe line assigning PREFIX in my perl.mak looks like:\n\n    PREFIX = /home/casey/opt/test spaces/\n\nShouldn't that argument have quotes around it?\n\nThe errors look like:\n\nmake -C perl prefix='/home/casey/opt/test spaces/' DESTDIR='' install\nmake[1]: Entering directory `/home/casey/scratch/git/master/perl'\nmake[2]: Entering directory `/home/casey/scratch/git/master/perl'\nInstalling /home/casey/opt/test/private-Error.3pm\nInstalling /home/casey/opt/test/Git.3pm\nWriting /home/casey/opt/test\nCan't open file /home/casey/opt/test: Is a directory at /usr/lib/perl5/5.8.5/ExtUtils/Install.pm line 209\nmake[2]: *** [pure_site_install] Error 255\nmake[2]: Leaving directory `/home/casey/scratch/git/master/perl'\nmake[1]: *** [install] Error 2\nmake[1]: Leaving directory `/home/casey/scratch/git/master/perl'\nmake: *** [install] Error 2\n\nprivate-Error.3pm and Git.3pm showed up in /home/casey/opt/test/\n\n\nThere are problems here with spaces, single quotes, and double quotes.\nI'll follow up in another email.\n\nMakeMaker version 6.17 (Revision: 1.133)\nperl v5.8.5\n\n-brandon\n\n\ndiff --git a/Makefile b/Makefile\nindex 0d373f7..affc288 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -1031,15 +1031,15 @@ endif\n # Shell quote (do not use $(call) to accommodate ancient setups);\n \n SHA1_HEADER_SQ = $(subst ','\\'',$(SHA1_HEADER))\n-ETC_GITCONFIG_SQ = $(subst ','\\'',$(ETC_GITCONFIG))\n+ETC_GITCONFIG_SQ = $(subst \",\\\",$(subst ','\\'',$(ETC_GITCONFIG)))\n \n DESTDIR_SQ = $(subst ','\\'',$(DESTDIR))\n bindir_SQ = $(subst ','\\'',$(bindir))\n-mandir_SQ = $(subst ','\\'',$(mandir))\n-infodir_SQ = $(subst ','\\'',$(infodir))\n-gitexecdir_SQ = $(subst ','\\'',$(gitexecdir))\n-template_dir_SQ = $(subst ','\\'',$(template_dir))\n-htmldir_SQ = $(subst ','\\'',$(htmldir))\n+mandir_SQ = $(subst \",\\\",$(subst ','\\'',$(mandir)))\n+infodir_SQ = $(subst \",\\\",$(subst ','\\'',$(infodir)))\n+gitexecdir_SQ = $(subst \",\\\",$(subst ','\\'',$(gitexecdir)))\n+template_dir_SQ = $(subst \",\\\",$(subst ','\\'',$(template_dir)))\n+htmldir_SQ = $(subst \",\\\",$(subst ','\\'',$(htmldir)))\n prefix_SQ = $(subst ','\\'',$(prefix))\n \n SHELL_PATH_SQ = $(subst ','\\'',$(SHELL_PATH))\n"},{"id":"86369","messageId":"7vy739nbmp.fsf@gitster.siamese.dyndns.org","threadId":"14850","inReplyTo":"lh6XIUcjpbjj8G8Ot7RQFlDitUn1njsc350QhnNmQkcgxlfluBPGZw@cipher.nrlssc.navy.mil","subject":"Re: [PATCH] perl/Makefile: handle paths with spaces in the NO_PERL_MAKEMAKER section","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-08-06T20:15:26Z","receivedAt":"2008-08-06T20:15:26Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Brandon Casey <casey@nrlssc.navy.mil> writes:\n\n> There are problems here with spaces, single quotes, and double quotes.\n> I'll follow up in another email.\n\nI guess we've opened up a large can of worms.  Let's have the minimum fix\nthat says \"We do support whitespace in these paths but no other funnies\"\nand leave the more intrusive one for post 1.6.0, for now.\n"},{"id":"86374","messageId":"S9LtwBbR-xqpcHr3teNenKBeyoVR63FrWUFS7_4iBRcVwE1vdOAZFw@cipher.nrlssc.navy.mil","threadId":"14850","inReplyTo":"7vy739nbmp.fsf@gitster.siamese.dyndns.org","subject":"[PATCH] perl/Makefile: handle paths with spaces by adding additional quoting","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2008-08-06T21:38:22Z","receivedAt":"2008-08-06T21:38:22Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>\n---\n\n\nJunio C Hamano wrote:\n> Brandon Casey <casey@nrlssc.navy.mil> writes:\n> \n>> There are problems here with spaces, single quotes, and double quotes.\n>> I'll follow up in another email.\n> \n> I guess we've opened up a large can of worms.  Let's have the minimum fix\n> that says \"We do support whitespace in these paths but no other funnies\"\n> and leave the more intrusive one for post 1.6.0, for now.\n\nThat is this patch.\n\nBUT. It produces some strangeties in the perl.mak file.\n\nPREFIX looks great:\n\n    PREFIX = '/home/casey/opt/test spaces/'\n\nbut then down in the $(MAKE_APERL_FILE) section we get something like:\n\n    PREFIX=''/home/casey/opt/test spaces/''\n\nbecause MakeMaker was already single quoting it.\n\nEverything compiles and installs correctly for me.\n\nIn addition to putting a space in the prefix path, I also tried semicolon,\ncolon, and backslash. semicolon didn't work, but it didn't work before either.\ncolon and backslash worked. A backslash in the prefix path produced some\ncomplaints when compiling some of the source files caused by the macros that\nI mentioned earlier that are used by some of the files. The warning was\n'unknown escape sequence ...'. The backslash was interpreted as an escape\nsequence and then just dropped, so the path compiled into the object files\nwas wrong. I guess this doesn't happen on windows?\n\nSummary: with this patch spaces in the prefix path work. It didn't break\n         anything that I tested.\n\nMaybe there's a MakeMaker expert in the audience?\n\n-brandon\n\n\n perl/Makefile |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/perl/Makefile b/perl/Makefile\nindex b8547db..6d2a200 100644\n--- a/perl/Makefile\n+++ b/perl/Makefile\n@@ -38,7 +38,7 @@ $(makfile): ../GIT-CFLAGS Makefile\n \techo '\techo $(instdir_SQ)' >> $@\n else\n $(makfile): Makefile.PL ../GIT-CFLAGS\n-\t$(PERL_PATH) $< PREFIX='$(prefix_SQ)'\n+\t$(PERL_PATH) $< PREFIX=\\''$(prefix_SQ)'\\'\n endif\n \n # this is just added comfort for calling make directly in perl dir\n-- \n1.5.6.2\n"},{"id":"86376","messageId":"h5b_Uh80WY7UfsGF2hRTiw_nv9rIwlIIGAe3N5lxpTRFqNsS9fmpGw@cipher.nrlssc.navy.mil","threadId":"14850","inReplyTo":"7v7iaurwe4.fsf@gitster.siamese.dyndns.org","subject":"[PATCH] perl/Makefile: make NO_PERL_MAKEMAKER section more robust","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2008-08-06T21:48:19Z","receivedAt":"2008-08-06T21:48:19Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"This adds the double single quote escaping that is performed for\nGIT_BUILD_OPTIONS to the paths in the install section to protect\nagainst paths with spaces, quotes or other funny characters in them.\n\nSigned-off-by: Brandon Casey <casey@nrlssc.navy.mil>\n---\n perl/Makefile |   11 ++++++-----\n 1 files changed, 6 insertions(+), 5 deletions(-)\n\ndiff --git a/perl/Makefile b/perl/Makefile\nindex b8547db..4c6b2a2 100644\n--- a/perl/Makefile\n+++ b/perl/Makefile\n@@ -29,13 +29,14 @@ $(makfile): ../GIT-CFLAGS Makefile\n \t'$(PERL_PATH_SQ)' -MError -e 'exit($$Error::VERSION < 0.15009)' || \\\n \techo '\tcp private-Error.pm blib/lib/Error.pm' >> $@\n \techo install: >> $@\n-\techo '\tmkdir -p $(instdir_SQ)' >> $@\n-\techo '\t$(RM) $(instdir_SQ)/Git.pm; cp Git.pm $(instdir_SQ)' >> $@\n-\techo '\t$(RM) $(instdir_SQ)/Error.pm' >> $@\n+\techo \"\tmkdir -p \"\\''$(subst ','\\'',$(instdir_SQ))'\\' >> $@\n+\techo \"\t$(RM) \"\\''$(subst ','\\'',$(instdir_SQ))/Git.pm'\\' >> $@\n+\techo \"\tcp Git.pm \"\\''$(subst ','\\'',$(instdir_SQ))'\\' >> $@\n+\techo \"\t$(RM) \"\\''$(subst ','\\'',$(instdir_SQ))/Error.pm'\\' >> $@\n \t'$(PERL_PATH_SQ)' -MError -e 'exit($$Error::VERSION < 0.15009)' || \\\n-\techo '\tcp private-Error.pm $(instdir_SQ)/Error.pm' >> $@\n+\techo \"\tcp private-Error.pm \"\\''$(subst ','\\'',$(instdir_SQ))/Error.pm'\\' >> $@\n \techo instlibdir: >> $@\n-\techo '\techo $(instdir_SQ)' >> $@\n+\techo \"\techo \"\\''$(subst ','\\'',$(instdir_SQ))'\\' >> $@\n else\n $(makfile): Makefile.PL ../GIT-CFLAGS\n \t$(PERL_PATH) $< PREFIX='$(prefix_SQ)'\n-- \n1.6.0.rc1.89.g2e7ef.dirty\n"},{"id":"86377","messageId":"1JOFfIWYHgmUErPhpB6xWtV5uZYv3_v3tBnt928x644O-1AquEzzIA@cipher.nrlssc.navy.mil","threadId":"14850","inReplyTo":"7vy739nbmp.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] perl/Makefile: handle paths with spaces in the NO_PERL_MAKEMAKER section","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2008-08-06T22:16:14Z","receivedAt":"2008-08-06T22:16:14Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"Junio C Hamano wrote:\n> Brandon Casey <casey@nrlssc.navy.mil> writes:\n> \n>> There are problems here with spaces, single quotes, and double quotes.\n>> I'll follow up in another email.\n> \n> I guess we've opened up a large can of worms.  Let's have the minimum fix\n> that says \"We do support whitespace in these paths but no other funnies\"\n> and leave the more intrusive one for post 1.6.0, for now.\n\nI think those two patches I just sent are enough.\n\nYou can apply the double-quote escaping patch I sent earlier if you want\n(the one that escapes double quotes in the macros compiled in c programs).\nBut we'd have a problem installing the perl scripts using MakeMaker, and\nwe'd have a problem _running_ the perl scripts since the single double\nquote causes a syntax error in the perl script. Let's wait till someone\nwants to have \" in their path shows up (and let them figure out how to\nfix it).\n\n-brandon\n"},{"id":"86383","messageId":"lWtENUxH2rUuPeH6fGlmuHzUPOVM2GJNQWM361G7sj6Za8Qm8qm3Wg@cipher.nrlssc.navy.mil","threadId":"14850","inReplyTo":"1JOFfIWYHgmUErPhpB6xWtV5uZYv3_v3tBnt928x644O-1AquEzzIA@cipher.nrlssc.navy.mil","subject":"Re: [PATCH] perl/Makefile: handle paths with spaces in the NO_PERL_MAKEMAKER section","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2008-08-07T00:23:14Z","receivedAt":"2008-08-07T00:23:14Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"Brandon Casey wrote:\n> Junio C Hamano wrote:\n>> Brandon Casey <casey@nrlssc.navy.mil> writes:\n>>\n>>> There are problems here with spaces, single quotes, and double quotes.\n>>> I'll follow up in another email.\n>> I guess we've opened up a large can of worms.  Let's have the minimum fix\n>> that says \"We do support whitespace in these paths but no other funnies\"\n>> and leave the more intrusive one for post 1.6.0, for now.\n> \n> I think those two patches I just sent are enough.\n> \n> You can apply the double-quote escaping patch I sent earlier if you want\n> (the one that escapes double quotes in the macros compiled in c programs).\n> But we'd have a problem installing the perl scripts using MakeMaker, and\n> we'd have a problem _running_ the perl scripts since the single double\n> quote causes a syntax error in the perl script. Let's wait till someone\n> wants to have \" in their path shows up (and let them figure out how to\n> fix it).\n\n\nok, here's a patch that allows me to compile, install using MakeMaker, and\nactually use the perl scripts generated by the make file when the installation\nprefix contains odd characters like double quote, single quote, space or\nsemi-colon. The patch below includes that patch I mentioned about escaping\ndouble quotes for c macros.\n\n-brandon\n\n\n--->8---\ndiff --git a/Makefile b/Makefile\nindex 0d373f7..21241b4 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -1031,15 +1031,15 @@ endif\n # Shell quote (do not use $(call) to accommodate ancient setups);\n \n SHA1_HEADER_SQ = $(subst ','\\'',$(SHA1_HEADER))\n-ETC_GITCONFIG_SQ = $(subst ','\\'',$(ETC_GITCONFIG))\n+ETC_GITCONFIG_SQ = $(subst \",\\\",$(subst ','\\'',$(ETC_GITCONFIG)))\n \n DESTDIR_SQ = $(subst ','\\'',$(DESTDIR))\n bindir_SQ = $(subst ','\\'',$(bindir))\n-mandir_SQ = $(subst ','\\'',$(mandir))\n-infodir_SQ = $(subst ','\\'',$(infodir))\n-gitexecdir_SQ = $(subst ','\\'',$(gitexecdir))\n-template_dir_SQ = $(subst ','\\'',$(template_dir))\n-htmldir_SQ = $(subst ','\\'',$(htmldir))\n+mandir_SQ = $(subst \",\\\",$(subst ','\\'',$(mandir)))\n+infodir_SQ = $(subst \",\\\",$(subst ','\\'',$(infodir)))\n+gitexecdir_SQ = $(subst \",\\\",$(subst ','\\'',$(gitexecdir)))\n+template_dir_SQ = $(subst \",\\\",$(subst ','\\'',$(template_dir)))\n+htmldir_SQ = $(subst \",\\\",$(subst ','\\'',$(htmldir)))\n prefix_SQ = $(subst ','\\'',$(prefix))\n \n SHELL_PATH_SQ = $(subst ','\\'',$(SHELL_PATH))\n@@ -1116,11 +1116,11 @@ perl/perl.mak: GIT-CFLAGS perl/Makefile perl/Makefile.PL\n \n $(patsubst %.perl,%,$(SCRIPT_PERL)): % : %.perl\n \t$(QUIET_GEN)$(RM) $@ $@+ && \\\n-\tINSTLIBDIR=`MAKEFLAGS= $(MAKE) -C perl -s --no-print-directory instlibdir` && \\\n+\tINSTLIBDIR=`MAKEFLAGS= $(MAKE) -C perl -s --no-print-directory instlibdir | sed -e 's/\"/\\\\\\\\\\\\\\\"/g'` && \\\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 '\ts=.*=use lib (split(/:/, $$ENV{GITPERLLIB} || q\"@@INSTLIBDIR@@\"));=' \\\n \t    -e '\tH' \\\n \t    -e '\tx' \\\n \t    -e '}' \\\n@@ -1134,7 +1134,7 @@ gitweb/gitweb.cgi: gitweb/gitweb.perl\n \t$(QUIET_GEN)$(RM) $@ $@+ && \\\n \tsed -e '1s|#!.*perl|#!$(PERL_PATH_SQ)|' \\\n \t    -e 's|++GIT_VERSION++|$(GIT_VERSION)|g' \\\n-\t    -e 's|++GIT_BINDIR++|$(bindir)|g' \\\n+\t    -e 's|++GIT_BINDIR++|$(subst \",\\\\\",$(bindir_SQ))|g' \\\n \t    -e 's|++GITWEB_CONFIG++|$(GITWEB_CONFIG)|g' \\\n \t    -e 's|++GITWEB_CONFIG_SYSTEM++|$(GITWEB_CONFIG_SYSTEM)|g' \\\n \t    -e 's|++GITWEB_HOME_LINK_STR++|$(GITWEB_HOME_LINK_STR)|g' \\\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex 90cd99b..155b1ac 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -29,7 +29,7 @@ our $my_uri = $cgi->url(-absolute => 1);\n \n # core git executable to use\n # this can just be \"git\" if your webserver has a sensible PATH\n-our $GIT = \"++GIT_BINDIR++/git\";\n+our $GIT = q\"++GIT_BINDIR++/git\";\n \n # absolute fs-path which will be prepended to the project path\n #our $projectroot = \"/pub/scm\";\ndiff --git a/perl/Makefile b/perl/Makefile\nindex dcbd2dd..2597d60 100644\n--- a/perl/Makefile\n+++ b/perl/Makefile\n@@ -39,7 +39,7 @@ $(makfile): ../GIT-CFLAGS Makefile\n \techo \"\techo \"\\''$(subst ','\\'',$(instdir_SQ))'\\' >> $@\n else\n $(makfile): Makefile.PL ../GIT-CFLAGS\n-\t$(PERL_PATH) $< PREFIX=\\''$(prefix_SQ)'\\'\n+\t$(PERL_PATH) $< PREFIX=\\''$(subst ','\\'',$(prefix_SQ))'\\'\n endif\n \n # this is just added comfort for calling make directly in perl dir\ndiff --git a/perl/Makefile.PL b/perl/Makefile.PL\nindex 320253e..e1e465c 100644\n--- a/perl/Makefile.PL\n+++ b/perl/Makefile.PL\n@@ -3,7 +3,7 @@ use ExtUtils::MakeMaker;\n sub MY::postamble {\n \treturn <<'MAKE_FRAG';\n instlibdir:\n-\t@echo '$(INSTALLSITELIB)'\n+\t@echo $(INSTALLSITELIB)\n \n MAKE_FRAG\n }\n-- \n1.5.6.2\n"}]}