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

PATCH: transform: hopefully the last word



This patch revises all of the program-transform-name stuff.  I've got
out of synch with the patches in this area, so this is based on last
night's CVS snapshot.

After this patch:

* all the documentation is built as it used to be, including zsh.texi
  in the distribution and zsh.info in the build tree, without any name
  transformation whatsoever (therefore targz-doc is now as it used to be)
* no files in the distribution or build directories ever have a
  transformed name
* nothing is installed with a completely untransformed name (this includes
  libzsh now being placed in a transformed-name directory)

and incidentally:

* everything works properly if yodl isn't available (yodl 1.14 doesn't
  compile on RedHat 6.1)
* the Makefiles are portable again (some use of $< in non-suffix rules
  had crept in)
* the cleaning rules get the source and build directories right
* the transformed basename is displayed by configure

The handling of info files is the only complexity.  zsh.texi is built in
the source tree as normal, with the untransformed name.  If requested with
"make zsh.info", a set of info files will be built in the build directory,
with untransformed names; these go into targz-doc, and can in any case be
perused in place.  "make install.info" builds a completely separate set
of info files, with the transformed name, then installs and deletes them.
Nothing is left in the build tree with the transformed names.

Those that are concerned about incorrect cross-references in the man
pages: I suggest that a note to the effect that the cross-references
may need to be munged is the best solution (leaving the text the same
everywhere).  However, the usual convention seems to be to just leave
cross-references referring to the canonical name.  I do not think that it
is at all confusing; if one has to type "man nw-zsh" to see the zsh man
page, then being referred to "zshexpn(1)" is unlikely to be misunderstood.

-zefram

diff -cr ../zsh-cvs-snapshot-08.12.1999.04.04.02/Config/defs.mk.in ./Config/defs.mk.in
*** ../zsh-cvs-snapshot-08.12.1999.04.04.02/Config/defs.mk.in	Mon Dec  6 16:40:37 1999
--- ./Config/defs.mk.in	Wed Dec  8 13:11:51 1999
***************
*** 28,39 ****
  SHELL = /bin/sh
  @SET_MAKE@
  
  # installation directories
  prefix          = @prefix@
  exec_prefix     = @exec_prefix@
  bindir          = @bindir@
  libdir          = @libdir@
! MODDIR          = $(libdir)/@tzsh@/$(VERSION)
  infodir         = @infodir@
  mandir          = @mandir@
  fndir           = @fndir@
--- 28,42 ----
  SHELL = /bin/sh
  @SET_MAKE@
  
+ # install basename
+ tzsh            = @tzsh@
+ 
  # installation directories
  prefix          = @prefix@
  exec_prefix     = @exec_prefix@
  bindir          = @bindir@
  libdir          = @libdir@
! MODDIR          = $(libdir)/$(tzsh)/$(VERSION)
  infodir         = @infodir@
  mandir          = @mandir@
  fndir           = @fndir@
***************
*** 80,86 ****
  LIBLDFLAGS='$(LIBLDFLAGS)' EXELDFLAGS='$(EXELDFLAGS)' \
  LIBS='$(LIBS)' DL_EXT='$(DL_EXT)' DLLD='$(DLLD)' \
  AWK='$(AWK)' YODL='$(YODL)' YODL2TXT='$(YODL2TXT)' YODL2HTML='$(YODL2HTML)' \
! FUNCTIONS_INSTALL='$(FUNCTIONS_INSTALL)'
  
  # override built-in suffix list
  .SUFFIXES:
--- 83,89 ----
  LIBLDFLAGS='$(LIBLDFLAGS)' EXELDFLAGS='$(EXELDFLAGS)' \
  LIBS='$(LIBS)' DL_EXT='$(DL_EXT)' DLLD='$(DLLD)' \
  AWK='$(AWK)' YODL='$(YODL)' YODL2TXT='$(YODL2TXT)' YODL2HTML='$(YODL2HTML)' \
! FUNCTIONS_INSTALL='$(FUNCTIONS_INSTALL)' tzsh='$(tzsh)'
  
  # override built-in suffix list
  .SUFFIXES:
diff -cr ../zsh-cvs-snapshot-08.12.1999.04.04.02/Doc/.cvsignore ./Doc/.cvsignore
*** ../zsh-cvs-snapshot-08.12.1999.04.04.02/Doc/.cvsignore	Mon Dec  6 04:33:11 1999
--- ./Doc/.cvsignore	Wed Dec  8 15:53:46 1999
***************
*** 1,7 ****
  Makefile
  version.yo
  zsh*.1
! zsh.texi*
  zsh.info*
  zsh_*.html
  zsh.aux zsh.toc
--- 1,7 ----
  Makefile
  version.yo
  zsh*.1
! zsh.texi
  zsh.info*
  zsh_*.html
  zsh.aux zsh.toc
***************
*** 13,15 ****
--- 13,16 ----
  zsh.log zsh.dvi
  zsh.tp zsh.tps
  zsh_*.ps
+ infodir
diff -cr ../zsh-cvs-snapshot-08.12.1999.04.04.02/Doc/.distfiles ./Doc/.distfiles
*** ../zsh-cvs-snapshot-08.12.1999.04.04.02/Doc/.distfiles	Mon Dec  6 04:33:11 1999
--- ./Doc/.distfiles	Wed Dec  8 13:52:16 1999
***************
*** 5,11 ****
      zsh.yo zshbuiltins.yo zshcompctl.yo zshcompsys.yo zshcompwid.yo
      zshexpn.yo zshmisc.yo zshmodules.yo zshoptions.yo zshparam.yo
      zshzftpsys.yo zshzle.yo
!     zsh.texi.in
      zsh.1 zshbuiltins.1 zshcompctl.1 zshcompsys.1 zshcompwid.1 zshexpn.1
      zshmisc.1 zshmodules.1 zshoptions.1 zshparam.1 zshzle.1 zshall.1
      zshzftpsys.1
--- 5,11 ----
      zsh.yo zshbuiltins.yo zshcompctl.yo zshcompsys.yo zshcompwid.yo
      zshexpn.yo zshmisc.yo zshmodules.yo zshoptions.yo zshparam.yo
      zshzftpsys.yo zshzle.yo
!     zsh.texi
      zsh.1 zshbuiltins.1 zshcompctl.1 zshcompsys.1 zshcompwid.1 zshexpn.1
      zshmisc.1 zshmodules.1 zshoptions.1 zshparam.1 zshzle.1 zshall.1
      zshzftpsys.1
diff -cr ../zsh-cvs-snapshot-08.12.1999.04.04.02/Doc/Makefile.in ./Doc/Makefile.in
*** ../zsh-cvs-snapshot-08.12.1999.04.04.02/Doc/Makefile.in	Tue Dec  7 16:28:22 1999
--- ./Doc/Makefile.in	Wed Dec  8 15:32:01 1999
***************
*** 50,56 ****
  zshoptions.1 zshparam.1 zshzftpsys.1 zshzle.1 zshall.1
  
  # yodl documentation
! YODLDOC = $(MAN) zsh.texi.in
  YODLSRC = zmacros.yo zman.yo ztexi.yo Zsh/arith.yo Zsh/builtins.yo \
  Zsh/compat.yo Zsh/compctl.yo Zsh/compsys.yo Zsh/compwid.yo Zsh/cond.yo \
  Zsh/exec.yo Zsh/expn.yo \
--- 50,56 ----
  zshoptions.1 zshparam.1 zshzftpsys.1 zshzle.1 zshall.1
  
  # yodl documentation
! YODLDOC = $(MAN) zsh.texi
  YODLSRC = zmacros.yo zman.yo ztexi.yo Zsh/arith.yo Zsh/builtins.yo \
  Zsh/compat.yo Zsh/compctl.yo Zsh/compsys.yo Zsh/compwid.yo Zsh/cond.yo \
  Zsh/exec.yo Zsh/expn.yo \
***************
*** 66,94 ****
  
  # ========== DEPENDENCIES FOR BUILDING ==========
  
- transform = @program_transform_name@
- 
  all: $(MAN) zsh.texi ../META-FAQ
  
  everything: all zsh.dvi zsh_us.ps zsh_a4.ps zsh_toc.html
  
  zsh.dvi: zsh.texi
! 	$(TEXI2DVI) zsh.texi
  
! $(sdir)/zsh.texi.in: $(sdir)/zsh.yo
! 	$(YODL) -o $(sdir)/zsh.texi.in -I$(sdir) -w ztexi.yo version.yo zsh.yo
  
! zsh.texi: $(sdir)/zsh.texi.in
! 	@test -f $< -a -s $<
! 	tzsh=`echo zsh | sed '$(transform); s/,/\\\\,/g'`; \
! 	sed "/@setfilename/{s/@setfilename //; s,zsh,$$tzsh, ; s/^/@setfilename /;}" < $< > zsh.texi
  
  .yo.1:
  	case $@ in \
  	  */*) target=$@ ;; \
  	  *) target=$(sdir)/$@ ;; \
  	esac; \
! 	$(YODL) -I$(sdir) -w zman.yo version.yo $< | sed -e '1s/\\-/-/g' -e '/^\.'\''/d' > $$target || exit 1; \
  	test -f $$target
  
  zsh_us.ps: zsh.dvi
--- 66,97 ----
  
  # ========== DEPENDENCIES FOR BUILDING ==========
  
  all: $(MAN) zsh.texi ../META-FAQ
  
  everything: all zsh.dvi zsh_us.ps zsh_a4.ps zsh_toc.html
  
  zsh.dvi: zsh.texi
! 	$(TEXI2DVI) $(sdir)/zsh.texi
  
! zsh.texi:
! 	case $@ in \
! 	  */*) target=$@ ;; \
! 	  *) target=$(sdir)/$@ ;; \
! 	esac; \
! 	$(YODL) -o $$target -I$(sdir) -w ztexi.yo version.yo zsh.yo; \
! 	test -f $$target
  
! zsh.info: zsh.texi
! 	$(MAKEINFO) $(sdir)/zsh.texi
  
  .yo.1:
  	case $@ in \
  	  */*) target=$@ ;; \
  	  *) target=$(sdir)/$@ ;; \
  	esac; \
! 	case '$(YODL)' in :*) ;; *) \
! 	    $(YODL) -I$(sdir) -w zman.yo version.yo $< | sed -e '1s/\\-/-/g' -e '/^\.'\''/d' > $$target \
! 	;; esac; \
  	test -f $$target
  
  zsh_us.ps: zsh.dvi
***************
*** 105,115 ****
  	  */*) target=$@ ;; \
  	  *) target=$(sdir)/$@ ;; \
  	esac; \
! 	$(YODL) -I$(sdir) -DZSHALL -w zman.yo version.yo zsh.yo | sed -e '1s/\\-/-/g' -e '/^\.'\''/d' > $$target || exit 1; \
  	test -f $$target
  
  ../META-FAQ: META-FAQ.yo Zsh/metafaq.yo
! 	$(YODL) -I$(sdir) META-FAQ.yo | sed -e '/NEXTLINE/N' -e '/DELLINE/d' -e '/^SECTHEAD$$/{N;s/^SECTHEAD.//;h;s/./-/g;H;g;}' -e 's/  *$$//' > $(sdir_top)/META-FAQ
  	test -f $(sdir_top)/META-FAQ
  
  $(YODLDOC): version.yo
--- 108,122 ----
  	  */*) target=$@ ;; \
  	  *) target=$(sdir)/$@ ;; \
  	esac; \
! 	case '$(YODL)' in :*) ;; *) \
! 	    $(YODL) -I$(sdir) -DZSHALL -w zman.yo version.yo zsh.yo | sed -e '1s/\\-/-/g' -e '/^\.'\''/d' > $$target \
! 	;; esac; \
  	test -f $$target
  
  ../META-FAQ: META-FAQ.yo Zsh/metafaq.yo
! 	case '$(YODL)' in :*) ;; *) \
! 	    $(YODL) -I$(sdir) META-FAQ.yo | sed -e '/NEXTLINE/N' -e '/DELLINE/d' -e '/^SECTHEAD$$/{N;s/^SECTHEAD.//;h;s/./-/g;H;g;}' -e 's/  *$$//' > $(sdir_top)/META-FAQ \
! 	;; esac
  	test -f $(sdir_top)/META-FAQ
  
  $(YODLDOC): version.yo
***************
*** 168,213 ****
  # 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 \
! 	  tfile=`echo $$file | sed "s,zsh,$$tzsh,"`; \
! 	sed "s/zshall/$${tzsh}all/; s/zshmisc/$${tzsh}misc/; s/zshexpn/$${tzsh}expn/; s/zshparam/$${tzsh}param/; s/zshoptions/$${tzsh}options/; s/zshbuiltins/$${tzsh}builtins/; s/zshzle/$${tzsh}zle/; s/zshcompwid/$${tzsh}compwid/; s/zshcompctl/$${tzsh}compctl/; s/zshmodules/$${tzsh}modules/; s/zshcompsys/$${tzsh}compsys/;" \
! 	$(sdir)/$$file >$(DESTDIR)$(mandir)/man1/$$tfile || 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 | 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 \
! 	    $(INSTALL_DATA) $(sdir)/$$file $(DESTDIR)$(infodir); \
! 	  else :; \
! 	   fi || exit 1; \
! 	done; \
! 	if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \
! 	  install-info --dir-file=$(DESTDIR)$(infodir)/dir $(DESTDIR)$(infodir)/$$tzsh.info; \
! 	else true; fi
! 
! install.html: zsh_toc.html
! 	$(sdir_top)/mkinstalldirs $(DESTDIR)$(htmldir)
! 	$(INSTALL_DATA) *.html $(DESTDIR)$(htmldir)
  
  # uninstall man pages
  uninstall.man:
  	for file in $(MAN); do \
! 	  tzsh=`echo zsh | sed '$(transform); s/,/\\\\,/g'`; \
! 	  tfile=`echo $$file | sed "s,zsh,$$tzsh,"`; \
! 	  rm -f $(DESTDIR)$(mandir)/man1/$$tfile; \
  	done
  
  # uninstall info pages
  uninstall.info:
! 	tzsh=`echo zsh | sed '$(transform)'`; \
! 	rm -f $(DESTDIR)$(infodir)/$$tzsh.info $(DESTDIR)$(infodir)/$$tzsh.info-[1-9]*
  
  # ========== DEPENDENCIES FOR CLEANUP ==========
  
--- 175,214 ----
  # install man pages, creating install directory if necessary
  install.man: $(MAN)
  	$(sdir_top)/mkinstalldirs $(DESTDIR)$(mandir)/man1
  	for file in $(MAN); do \
! 	    $(INSTALL_DATA) $(sdir)/$$file $(DESTDIR)$(mandir)/man1/`echo $$file | sed 's|zsh|$(tzsh)|'` || exit 1; \
  	done
  
  # install info pages, creating install directory if necessary
  install.info: zsh.texi
  	$(sdir_top)/mkinstalldirs $(DESTDIR)$(infodir)
! 	rm -rf infodir
! 	mkdir infodir
! 	if ( \
! 	    sed '/^@setfilename/s|zsh|$(tzsh)|' \
! 		< $(sdir)/zsh.texi > infodir/tzsh.texi && \
! 	    (cd infodir && $(MAKEINFO) tzsh.texi) && \
! 	    for file in infodir/$(tzsh).info*; do \
! 		$(INSTALL_DATA) $$file $(DESTDIR)$(infodir) || exit 1; \
! 	    done \
! 	); then \
! 	    rm -rf infodir; \
! 	    exit 0; \
! 	else \
! 	    rm -rf infodir; \
! 	    exit 1; \
! 	fi
  
  # uninstall man pages
  uninstall.man:
  	for file in $(MAN); do \
! 	    rm -f $(DESTDIR)$(mandir)/man1/`echo $$file | sed 's|zsh|$(tzsh)|'`; \
  	done
  
  # uninstall info pages
  uninstall.info:
! 	rm -f $(DESTDIR)$(infodir)/$(tzsh).info
! 	rm -f $(DESTDIR)$(infodir)/$(tzsh).info-[1-9]*
  
  # ========== DEPENDENCIES FOR CLEANUP ==========
  
***************
*** 215,226 ****
  	rm -f *.html *.info* *.dvi *.ps
  	rm -f *.aux *.cp *.cps *.fn *.fns *.ky *.log
  	rm -f *.pg *.pgs *.toc *.tp *.tps *.vr *.vrs
  
  distclean-here: clean-here
! 	rm -f Makefile *.1 *.texi
  
  realclean-here: distclean-here
! 	cd $(sdir) && rm -f version.yo ../META-FAQ zsh.yo
  
  @CLEAN_MK@
  
--- 216,228 ----
  	rm -f *.html *.info* *.dvi *.ps
  	rm -f *.aux *.cp *.cps *.fn *.fns *.ky *.log
  	rm -f *.pg *.pgs *.toc *.tp *.tps *.vr *.vrs
+ 	rm -rf infodir
  
  distclean-here: clean-here
! 	rm -f Makefile
  
  realclean-here: distclean-here
! 	cd $(sdir) && rm -f version.yo ../META-FAQ zsh.texi $(MAN)
  
  @CLEAN_MK@
  
diff -cr ../zsh-cvs-snapshot-08.12.1999.04.04.02/Makefile.in ./Makefile.in
*** ../zsh-cvs-snapshot-08.12.1999.04.04.02/Makefile.in	Mon Dec  6 04:33:02 1999
--- ./Makefile.in	Wed Dec  8 15:52:35 1999
***************
*** 87,96 ****
  install.info uninstall.info:
  	@cd Doc && $(MAKE) $(MAKEDEFS) $@
  
- # install/uninstall just the html pages
- install.html uninstall.html:
- 	@cd Doc && $(MAKE) $(MAKEDEFS) $@
- 
  # ========== DEPENDENCIES FOR CLEANUP ==========
  
  @CLEAN_MK@
--- 87,92 ----
diff -cr ../zsh-cvs-snapshot-08.12.1999.04.04.02/Src/Makefile.in ./Src/Makefile.in
*** ../zsh-cvs-snapshot-08.12.1999.04.04.02/Src/Makefile.in	Mon Dec  6 04:33:18 1999
--- ./Src/Makefile.in	Wed Dec  8 13:12:41 1999
***************
*** 68,74 ****
  ENTRYOBJ   = modentry..o
  NNTRYOBJ   =
  
! LDRUNPATH = LD_RUN_PATH=$(libdir)/zsh
  NDRUNPATH =
  
  zsh: $(@L@IBZSH) $(@L@STMP) $(MAIN_OBJS) zsh.export
--- 68,74 ----
  ENTRYOBJ   = modentry..o
  NNTRYOBJ   =
  
! LDRUNPATH = LD_RUN_PATH=$(libdir)/$(tzsh)
  NDRUNPATH =
  
  zsh: $(@L@IBZSH) $(@L@STMP) $(MAIN_OBJS) zsh.export
***************
*** 150,157 ****
  
  # ========== DEPENDENCIES FOR INSTALLING ==========
  
- transform = @program_transform_name@
- 
  install: install.bin install.modules
  uninstall: uninstall.bin uninstall.modules
  
--- 150,155 ----
***************
*** 161,189 ****
  # install binary, creating install directory if necessary
  install.bin-here: zsh install.bin-@L@
  	$(sdir_top)/mkinstalldirs $(DESTDIR)$(bindir)
! 	tzsh=`echo zsh | sed '$(transform)'`; \
! 	$(INSTALL_PROGRAM) $(STRIPFLAGS) zsh $(DESTDIR)$(bindir)/$$tzsh-$(VERSION) && \
! 	if test -f $(DESTDIR)$(bindir)/$$tzsh; then \
! 	    rm -f $(DESTDIR)$(bindir)/$$tzsh.old; \
! 	    $(LN) $(DESTDIR)$(bindir)/$$tzsh $(DESTDIR)$(bindir)/$$tzsh.old; \
! 	else :; fi && \
! 	rm -f $(DESTDIR)$(bindir)/$$tzsh.new && \
! 	$(LN) $(DESTDIR)$(bindir)/$$tzsh-$(VERSION) $(DESTDIR)$(bindir)/$$tzsh.new && \
! 	mv $(DESTDIR)$(bindir)/$$tzsh.new $(DESTDIR)$(bindir)/$$tzsh
  
  install.bin-N:
  install.bin-L: $(LIBZSH)
! 	$(sdir_top)/mkinstalldirs $(DESTDIR)$(libdir)/zsh
! 	$(INSTALL_PROGRAM) $(LIBZSH) $(DESTDIR)$(libdir)/zsh/$(LIBZSH)
  
  # uninstall binary
  uninstall.bin-here: uninstall.bin-@L@
! 	tzsh=`echo zsh | sed '$(transform)'`; \
! 	rm -f $(DESTDIR)$(bindir)/$$tzsh-$(VERSION) $(DESTDIR)$(bindir)/$$tzsh
  
  uninstall.bin-N:
  uninstall.bin-L:
! 	rm -f $(DESTDIR)$(libdir)/zsh/$(LIBZSH)
  
  # ========== DEPENDENCIES FOR CLEANUP ==========
  
--- 159,185 ----
  # install binary, creating install directory if necessary
  install.bin-here: zsh install.bin-@L@
  	$(sdir_top)/mkinstalldirs $(DESTDIR)$(bindir)
! 	$(INSTALL_PROGRAM) $(STRIPFLAGS) zsh $(DESTDIR)$(bindir)/$(tzsh)-$(VERSION)
! 	if test -f $(DESTDIR)$(bindir)/$(tzsh); then \
! 	    rm -f $(DESTDIR)$(bindir)/$(tzsh).old; \
! 	    $(LN) $(DESTDIR)$(bindir)/$(tzsh) $(DESTDIR)$(bindir)/$(tzsh).old; \
! 	else :; fi
! 	rm -f $(DESTDIR)$(bindir)/$(tzsh).new
! 	$(LN) $(DESTDIR)$(bindir)/$(tzsh)-$(VERSION) $(DESTDIR)$(bindir)/$(tzsh).new
! 	mv $(DESTDIR)$(bindir)/$(tzsh).new $(DESTDIR)$(bindir)/$(tzsh)
  
  install.bin-N:
  install.bin-L: $(LIBZSH)
! 	$(sdir_top)/mkinstalldirs $(DESTDIR)$(libdir)/$(tzsh)
! 	$(INSTALL_PROGRAM) $(LIBZSH) $(DESTDIR)$(libdir)/$(tzsh)/$(LIBZSH)
  
  # uninstall binary
  uninstall.bin-here: uninstall.bin-@L@
! 	rm -f $(DESTDIR)$(bindir)/$(tzsh)-$(VERSION) $(DESTDIR)$(bindir)/$(tzsh)
  
  uninstall.bin-N:
  uninstall.bin-L:
! 	rm -f $(DESTDIR)$(libdir)/$(tzsh)/$(LIBZSH)
  
  # ========== DEPENDENCIES FOR CLEANUP ==========
  
diff -cr ../zsh-cvs-snapshot-08.12.1999.04.04.02/configure.in ./configure.in
*** ../zsh-cvs-snapshot-08.12.1999.04.04.02/configure.in	Tue Dec  7 22:41:58 1999
--- ./configure.in	Wed Dec  8 14:07:03 1999
***************
*** 1595,1600 ****
--- 1595,1601 ----
  fi
  echo "\
  library flags             : ${LIBS}
+ installation basename     : ${tzsh_name}
  binary install path       : ${zshbin2}
  man page install path     : ${zshman}
  info install path         : ${zshinfo}"
END



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