git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] perl/Makefile: handle paths with spaces by adding additional quoting

From
Brandon Casey <casey@nrlssc.navy.mil>
Date
Aug 6, 2008, 21:38 UTC
Message-ID
<S9LtwBbR-xqpcHr3teNenKBeyoVR63FrWUFS7_4iBRcVwE1vdOAZFw@cipher.nrlssc.navy.mil>
In-Reply-To
<7vy739nbmp.fsf@gitster.siamese.dyndns.org>
Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
---
Junio C Hamano wrote:
Show 8 quoted lines
> Brandon Casey <casey@nrlssc.navy.mil> writes:
> 
>> There are problems here with spaces, single quotes, and double quotes.
>> I'll follow up in another email.
> 
> I guess we've opened up a large can of worms.  Let's have the minimum fix
> that says "We do support whitespace in these paths but no other funnies"
> and leave the more intrusive one for post 1.6.0, for now.
That is this patch.
BUT. It produces some strangeties in the perl.mak file.
PREFIX looks great:
    PREFIX = '/home/casey/opt/test spaces/'
but then down in the $(MAKE_APERL_FILE) section we get something like:
    PREFIX=''/home/casey/opt/test spaces/''
because MakeMaker was already single quoting it.
Everything compiles and installs correctly for me.

In addition to putting a space in the prefix path, I also tried semicolon, colon, and backslash. semicolon didn't work, but it didn't work before either. colon and backslash worked. A backslash in the prefix path produced some complaints when compiling some of the source files caused by the macros that I mentioned earlier that are used by some of the files. The warning was 'unknown escape sequence ...'. The backslash was interpreted as an escape sequence and then just dropped, so the path compiled into the object files was wrong. I guess this doesn't happen on windows?

Summary: with this patch spaces in the prefix path work. It didn't break
         anything that I tested.
Maybe there's a MakeMaker expert in the audience?
-brandon
 perl/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/perl/Makefile b/perl/Makefile
index b8547db..6d2a200 100644
--- a/perl/Makefile
+++ b/perl/Makefile
@@ -38,7 +38,7 @@ $(makfile): ../GIT-CFLAGS Makefile
 	echo '	echo $(instdir_SQ)' >> $@
 else
 $(makfile): Makefile.PL ../GIT-CFLAGS
-	$(PERL_PATH) $< PREFIX='$(prefix_SQ)'
+	$(PERL_PATH) $< PREFIX=\''$(prefix_SQ)'\'
 endif
 
 # this is just added comfort for calling make directly in perl dir
-- 
1.5.6.2
Previous: Junio C HamanoNext: Brandon Casey
Message 7 of 10 in “perl/Makefile: handle paths with spaces in the NO_PERL_MAKEMAKER section”
  1. perl/Makefile: handle paths with spaces in the NO_PERL_MAKEMAKER sectionBrandon Casey, Aug 5, 2008
  2. Junio C HamanoAug 5, 2008
  3. Brandon CaseyAug 6, 2008
  4. Junio C HamanoAug 6, 2008
  5. Brandon CaseyAug 6, 2008
  6. Junio C HamanoAug 6, 2008
  7. perl/Makefile: handle paths with spaces by adding additional quotingBrandon Casey, Aug 6, 2008
  8. Brandon CaseyAug 6, 2008
  9. Brandon CaseyAug 7, 2008
  10. perl/Makefile: make NO_PERL_MAKEMAKER section more robustBrandon Casey, Aug 6, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.