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

[PATCH] perl/Makefile: make NO_PERL_MAKEMAKER section more robust

From
Brandon Casey <casey@nrlssc.navy.mil>
Date
Aug 6, 2008, 21:48 UTC
Message-ID
<h5b_Uh80WY7UfsGF2hRTiw_nv9rIwlIIGAe3N5lxpTRFqNsS9fmpGw@cipher.nrlssc.navy.mil>
In-Reply-To
<7v7iaurwe4.fsf@gitster.siamese.dyndns.org>

This adds the double single quote escaping that is performed for GIT_BUILD_OPTIONS to the paths in the install section to protect against paths with spaces, quotes or other funny characters in them.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
---
 perl/Makefile |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/perl/Makefile b/perl/Makefile
index b8547db..4c6b2a2 100644
--- a/perl/Makefile
+++ b/perl/Makefile
@@ -29,13 +29,14 @@ $(makfile): ../GIT-CFLAGS Makefile
 	'$(PERL_PATH_SQ)' -MError -e 'exit($$Error::VERSION < 0.15009)' || \
 	echo '	cp private-Error.pm blib/lib/Error.pm' >> $@
 	echo install: >> $@
-	echo '	mkdir -p $(instdir_SQ)' >> $@
-	echo '	$(RM) $(instdir_SQ)/Git.pm; cp Git.pm $(instdir_SQ)' >> $@
-	echo '	$(RM) $(instdir_SQ)/Error.pm' >> $@
+	echo "	mkdir -p "\''$(subst ','\'',$(instdir_SQ))'\' >> $@
+	echo "	$(RM) "\''$(subst ','\'',$(instdir_SQ))/Git.pm'\' >> $@
+	echo "	cp Git.pm "\''$(subst ','\'',$(instdir_SQ))'\' >> $@
+	echo "	$(RM) "\''$(subst ','\'',$(instdir_SQ))/Error.pm'\' >> $@
 	'$(PERL_PATH_SQ)' -MError -e 'exit($$Error::VERSION < 0.15009)' || \
-	echo '	cp private-Error.pm $(instdir_SQ)/Error.pm' >> $@
+	echo "	cp private-Error.pm "\''$(subst ','\'',$(instdir_SQ))/Error.pm'\' >> $@
 	echo instlibdir: >> $@
-	echo '	echo $(instdir_SQ)' >> $@
+	echo "	echo "\''$(subst ','\'',$(instdir_SQ))'\' >> $@
 else
 $(makfile): Makefile.PL ../GIT-CFLAGS
 	$(PERL_PATH) $< PREFIX='$(prefix_SQ)'
-- 
1.6.0.rc1.89.g2e7ef.dirty
Previous: Brandon Casey
Message 10 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.