Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: reproducing release tarball for 5.0.7



On Thu, 09 Oct 2014 23:34:20 +0200
Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
> So I tried
> % cd Etc
> % make
> cd . && yodl2txt FAQ.yo && mv -f FAQ.txt FAQ
> FAQ.yo:1: Can't read `txt'
> /usr/bin/yodl indicates failure!
> make: *** [FAQ] Error 1
> Makefile:191: recipe for target 'FAQ' failed
> 
> Which is a confusing error message.

This works around it if the Yodl installation is fairly standard, though
it's not clear to me it's our job to do so.

Did I miss some much simpler standard Bourne shell way of finding what
directory a command is in?

diff --git a/Etc/Makefile.in b/Etc/Makefile.in
index b6743a7..fed35c7 100644
--- a/Etc/Makefile.in
+++ b/Etc/Makefile.in
@@ -42,11 +42,42 @@ INSTALL         = @INSTALL@
 
 all: FAQ
 
+# Some Yodl installations don't have correct paths to include
+# the standard macros, so find them.
+
 FAQ: FAQ.yo
-	cd $(sdir) && $(YODL2TXT) FAQ.yo && mv -f FAQ.txt FAQ
+	pathsplit=`echo $$PATH | sed 's%:% %g'`; \
+	include=`for p in $$pathsplit; do \
+	  if [ -e $$p/$(YODL2TXT) ]; then \
+	    echo $$p | sed -e 's%/bin$$%%'; \
+	    break; \
+	  fi; \
+	done`; \
+	if [ x$$include != x ]; then \
+	  if [ -d $$include/share/yodl ]; then \
+	    include="-I$$include/share/yodl"; \
+	  else \
+	    include=''; \
+	  fi; \
+	fi; \
+	cd $(sdir) && $(YODL2TXT) $$include FAQ.yo && mv -f FAQ.txt FAQ
 
 FAQ.html: FAQ.yo
-	$(YODL2HTML) $(sdir)/FAQ.yo
+	pathsplit=`echo $$PATH | sed 's%:% %g'`; \
+	include=`for p in $$pathsplit; do \
+	  if [ -e $$p/$(YODL2HTML) ]; then \
+	    echo $$p | sed -e 's%/bin$$%%'; \
+	    break; \
+	  fi; \
+	done`; \
+	if [ x$$include != x ]; then \
+	  if [ -d $$include/share/yodl ]; then \
+	    include="-I$$include/share/yodl"; \
+	  else \
+	    include=''; \
+	  fi; \
+	fi; \
+	$(YODL2HTML) $$include $(sdir)/FAQ.yo
 
 # ========== DEPENDENCIES FOR CLEANUP ==========
 

pws

-- 
Peter Stephenson <p.stephenson@xxxxxxxxxxx>  Principal Software Engineer
Tel: +44 (0)1223 434724                Samsung Cambridge Solution Centre
St John's House, St John's Innovation Park, Cowley Road,
Cambridge, CB4 0DS, UK



Messages sorted by: Reverse Date, Date, Thread, Author