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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux