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

Re: PATCH: Program transform name, again



On Dec 6, 10:14am, Zefram wrote:
} Subject: Re: PATCH: Program transform name, again
}
} No, no, this is all wrong.  You should be doing
} 
} 	tzsh=`echo zsh | sed '@program_transform_name@'`
} 
} and then in each installed filename replace the substring "zsh" with
} "$(tzsh)".

Oh, of course.  How silly of me.

This should be installed INSTEAD OF Clint's 8915, which arrived just as
I pasted the patch below into my editor buffer.  They're almost identical,
but I've covered quoting of commas in the transformed name and avoided
using slashes as sed separators in case the name prefix has one.  Also,
this fixes the @setfilename line inside zsh.texi, which Clint missed.

Index: Doc/Makefile.in
===================================================================
@@ -80,7 +80,8 @@
 
 zsh.texi: $(sdir)/zsh.texi.in
 	@test -f $< -a -s $<
-	sed '/@setfilename/{; s/@setfilename //; $(transform) ; s/^/@setfilename /;}' < $< > zsh.texi
+	tzsh=`echo zsh | sed '$(transform); s/,/\\\\,/g'`; \
+	sed "/@setfilename/{; s/@setfilename //; s,zsh,$$tzsh, ; s/^/@setfilename /;}" < $< > zsh.texi
 
 .yo.1:
 	@case $@ in \
@@ -169,23 +170,24 @@
 # install man pages, creating install directory if necessary
 install.man: $(MAN)
 	$(sdir_top)/mkinstalldirs $(DESTDIR)$(mandir)/man1
+	tzsh=`echo zsh | sed '$(transform); s/,/\\\\,/g'`; \
 	for file in $(MAN); do \
-	  tzsh=`echo $$file | sed '$(transform)'`; \
+	  tfile=`echo $$file | sed "s,zsh,$$tzsh,"`; \
 	  if test -f $$file; then \
-	    cp -f $$file $$tzsh; \
+	    cp -f $$file $$tfile; \
 	  elif test -f $(sdir)/$$file; then \
-	    cp -f $(sdir)/$$file $$tzsh; \
+	    cp -f $(sdir)/$$file $$tfile; \
 	  else :; \
 	  fi || exit 1; \
-	  $(INSTALL_DATA) $$tzsh $(DESTDIR)$(mandir)/man1 || exit 1; \
+	  $(INSTALL_DATA) $$tfile $(DESTDIR)$(mandir)/man1 || exit 1; \
 	done
 
 # install info pages, creating install directory if necessary
 install.info: zsh.texi
 	$(MAKEINFO) zsh.texi
 	$(sdir_top)/mkinstalldirs $(DESTDIR)$(infodir)
-	tzsh=`echo zsh.info | sed '$(transform)'`; \
-	for file in $$tzsh $$tzsh-[1-9]*; do \
+	tzsh=`echo zsh | sed '$(transform)'`; \
+	for file in $$tzsh.info $$tzsh.info-[1-9]*; do \
 	  if test -f $$file; then \
 	    $(INSTALL_DATA) $$file $(DESTDIR)$(infodir); \
 	  elif test -f $(sdir)/$$file; then \
@@ -204,8 +206,9 @@
 # uninstall man pages
 uninstall.man:
 	for file in $(MAN); do \
-	  tzsh=`echo zsh | sed '$(transform)'`; \
-	  rm -f $(DESTDIR)$(mandir)/man1/$$tzsh; \
+	  tzsh=`echo zsh | sed '$(transform); s/,/\\\\,/g'`; \
+	  tfile=`echo $$file | sed "s,zsh,$$tzsh,"`; \
+	  rm -f $(DESTDIR)$(mandir)/man1/$$tfile; \
 	done
 
 # uninstall info pages

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



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