build: make install in "/doc" failed if the destination dir contained spaces
authormuxator <a.mux@inwind.it>
Wed, 11 Oct 2017 01:19:48 +0200
changeset 34622 b584ed1b225d
parent 34621 5613fb1583d6
child 34623 baa522889540
build: make install in "/doc" failed if the destination dir contained spaces This and the following commits try to add the necessary quoting in the build scripts to make the process more robust. The target for now is rendering "make deb" successful even when the base directory contains spaces (eg. "/opt/mercu rial"). The build process should succeed without scattering files in spurious directories (eg.: "/opt/mercu/usr/bin/hg").
doc/Makefile
--- a/doc/Makefile	Thu Oct 05 16:13:05 2017 +0200
+++ b/doc/Makefile	Wed Oct 11 01:19:48 2017 +0200
@@ -18,7 +18,7 @@
 html: $(HTML)
 
 common.txt $(SOURCES) $(SOURCES:%.txt=%.gendoc.txt): $(GENDOC)
-	${PYTHON} gendoc.py $(basename $@) > $@.tmp
+	${PYTHON} gendoc.py "$(basename $@)" > $@.tmp
 	mv $@.tmp $@
 
 %: %.txt %.gendoc.txt common.txt
@@ -39,8 +39,8 @@
 install: man
 	for i in $(MAN) ; do \
 	  subdir=`echo $$i | sed -n 's/^.*\.\([0-9]\)$$/man\1/p'` ; \
-	  mkdir -p $(DESTDIR)$(MANDIR)/$$subdir ; \
-	  $(INSTALL) $$i $(DESTDIR)$(MANDIR)/$$subdir ; \
+	  mkdir -p "$(DESTDIR)$(MANDIR)"/$$subdir ; \
+	  $(INSTALL) $$i "$(DESTDIR)$(MANDIR)"/$$subdir ; \
 	done
 
 clean: