zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: zsh-workers@zsh.org
Subject: Re: modify functions hierarchy (was: Install run-help and *.zwc files system wide in build system)
Date: Wed, 20 Nov 2013 19:26:08 +0000	[thread overview]
Message-ID: <20131120192608.3af3b92c@pws-pc.ntlworld.com> (raw)
In-Reply-To: <131117130118.ZM1041@torch.brasslantern.com>

On Sun, 17 Nov 2013 13:01:18 -0800
Bart Schaefer <schaefer@brasslantern.com> wrote:
> I'm looking at, for example, Doc/Makefile.in "install.info" which
> creates a local directory named "infodir" where it builds tzsh.texi
> and then installs into the target location and removes infodir again
> when it's finished.  Why is generating helfiles from the pre-built
> manual pages different than this?

OK, is this good enough?

If it's roughly on lines no one objects to, I'll commit it and let
anyone else tie up the loose ends with other patches.  Otherwise, I'll
leave it to someone else to have yet a third go.

If anyone thinks there's anything else left to do (presumably just local
tweaks at this stage), please also supply a patch.

diff --git a/Config/defs.mk.in b/Config/defs.mk.in
index 58ef110..5c19cc4 100644
--- a/Config/defs.mk.in
+++ b/Config/defs.mk.in
@@ -51,6 +51,7 @@ sitefndir       = @sitefndir@
 scriptdir       = @scriptdir@
 sitescriptdir   = @sitescriptdir@
 htmldir         = @htmldir@
+runhelpdir      = @runhelpdir@
 
 # compilation
 CC              = @CC@
diff --git a/Config/installfns.sh b/Config/installfns.sh
index cf587c4..149f359 100755
--- a/Config/installfns.sh
+++ b/Config/installfns.sh
@@ -10,6 +10,8 @@ allfuncs="`grep ' functions=.' ${dir_top}/config.modules |
 
 allfuncs="`cd $sdir_top; echo ${allfuncs}`"
 
+test -d installfnsdir || mkdir installfnsdir
+
 # We now have a list of files, but we need to use `test -f' to check
 # (1) the glob got expanded (2) we are not looking at directories.
 for file in $allfuncs; do
@@ -44,8 +46,22 @@ for file in $allfuncs; do
         ;;
       esac
     fi
-    test -d $instdir || /bin/sh $sdir_top/mkinstalldirs $instdir || exit 1
-    $INSTALL_DATA $sdir_top/$file $instdir || exit 1
+    basename=`basename $file`
+    ok=0
+    if test -d $instdir || /bin/sh $sdir_top/mkinstalldirs $instdir; then
+      if sed "s|@runhelpdir@|$runhelpdir|" <$sdir_top/$file \
+        >installfnsdir/$basename; then
+	if $INSTALL_DATA installfnsdir/$basename $instdir; then
+	  ok=1
+	fi
+      fi
+    fi
+    case $ok in
+      0)
+      rm -rf installfnsdir
+      exit 1
+      ;;
+    esac
     read line < $sdir_top/$file
     case "$line" in
       '#!'*)
@@ -54,3 +70,5 @@ for file in $allfuncs; do
     esac
   fi
 done
+
+rm -rf installfnsdir
diff --git a/Doc/Makefile.in b/Doc/Makefile.in
index 5893cc8..eae3301 100644
--- a/Doc/Makefile.in
+++ b/Doc/Makefile.in
@@ -33,7 +33,6 @@ dir_top = ..
 VPATH           = @srcdir@
 sdir            = @srcdir@
 sdir_top        = @top_srcdir@
-runhelpdir      = @runhelpdir@
 INSTALL         = @INSTALL@
 LN_S            = @LN_S@
 
diff --git a/Functions/Misc/run-help b/Functions/Misc/run-help
index c817b67..e351dd6 100644
--- a/Functions/Misc/run-help
+++ b/Functions/Misc/run-help
@@ -10,7 +10,7 @@
 
 emulate -RL zsh
 
-local HELPDIR="${HELPDIR:-/usr/share/zsh/$ZSH_VERSION/help}"
+local HELPDIR="${HELPDIR:-@runhelpdir@}"
 
 [[ $1 == "." ]] && 1="dot"
 [[ $1 == ":" ]] && 1="colon"
diff --git a/Makefile.in b/Makefile.in
index d771033..cb74e94 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -88,7 +88,7 @@ install.fns:
 	  test x$(sitefndir) != xno && \
 	    $(SHELL) $(sdir_top)/mkinstalldirs $(DESTDIR)$(sitefndir); \
 	  sdir_top="$(sdir_top)" fndir="$(fndir)" dir_top="$(dir_top)" \
-	  scriptdir="$(scriptdir)" \
+	  scriptdir="$(scriptdir)" runhelpdir="$(runhelpdir)" \
 	  FUNCTIONS_SUBDIRS="$(FUNCTIONS_SUBDIRS)" \
 	  INSTALL_DATA="$(INSTALL_DATA)" \
 	  INSTALL_PROGRAM="$(INSTALL_PROGRAM)" \

-- 
Peter Stephenson <p.w.stephenson@ntlworld.com>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/


  parent reply	other threads:[~2013-11-20 19:26 UTC|newest]

Thread overview: 79+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-10  8:57 Install run-help and *.zwc files system wide in build system Martin Vaeth
2013-11-10 18:13 ` Peter Stephenson
2013-11-10 22:28   ` Martin Vaeth
2013-11-11  2:30     ` Bart Schaefer
2013-11-11  9:09       ` Martin Vaeth
2013-11-11 16:42         ` Bart Schaefer
2013-11-11 22:59           ` Martin Vaeth
2013-11-12 10:11             ` Peter Stephenson
2013-11-12 17:41               ` Martin Vaeth
2013-11-12 17:48                 ` Peter Stephenson
2013-11-12 21:04                   ` Peter Stephenson
2013-11-12 21:42                     ` Martin Vaeth
2013-11-13  9:28                       ` Peter Stephenson
2013-11-13 10:10                         ` Martin Vaeth
2013-11-13 11:21                           ` Peter Stephenson
2013-11-13 16:06                             ` Bart Schaefer
2013-11-16 12:14                               ` modify functions hierarchy (was: Install run-help and *.zwc files system wide in build system) Martin Vaeth
2013-11-17 18:30                                 ` Bart Schaefer
2013-11-17 19:42                                   ` Martin Vaeth
2013-11-17 21:01                                     ` Bart Schaefer
2013-11-18  7:00                                       ` Martin Vaeth
2013-11-18 16:11                                         ` Doc/Doc/help (was: modify functions hierarchy (was: Install run-help and *.zwc files system wide in build system)) Bart Schaefer
2013-11-18 16:23                                           ` Peter Stephenson
2013-11-18 16:31                                             ` Bart Schaefer
2013-11-18 16:36                                               ` Peter Stephenson
2013-11-18 16:45                                                 ` Bart Schaefer
2013-11-18 16:58                                                   ` Peter Stephenson
2013-11-20 19:26                                       ` Peter Stephenson [this message]
2013-11-21  6:01                                         ` modify functions hierarchy (was: Install run-help and *.zwc files system wide in build system) Bart Schaefer
2013-11-23 17:48                                           ` Peter Stephenson
2013-11-23 19:47                                             ` Helpfiles again (was Re: modify functions hierarchy (was: etc.)) Bart Schaefer
2013-11-23 21:25                                               ` Martin Vaeth
2013-11-24  5:06                                                 ` Bart Schaefer
     [not found]                                                   ` <20131124175649.27c2559a@pws!>
2013-11-24 12:26                                                   ` Martin Vaeth
2013-11-24 12:31                                                     ` Martin Vaeth
2013-11-24 17:56                                                   ` Peter Stephenson
2013-11-25  8:18                                                     ` Bart Schaefer
2013-11-25 14:24                                                       ` Jun T.
2013-11-25 15:49                                                         ` Peter Stephenson
2013-11-25 16:56                                                           ` Bart Schaefer
2013-11-25 17:37                                                             ` Peter Stephenson
2013-11-25 20:14                                                             ` Phil Pennock
2013-11-26  9:24                                                               ` Peter Stephenson
2013-12-12 22:17                                                             ` PATCH: Util/helpfiles failing on old-fashioned unix pda
2013-12-13  9:08                                                               ` Martin Vaeth
2013-12-13 23:46                                                                 ` Martin Vaeth
2013-12-14  0:20                                                                 ` Wayne Davison
2013-12-14  9:23                                                                   ` Martin Vaeth
2013-12-14 18:49                                                                     ` Bart Schaefer
2013-12-15 23:37                                                                 ` pda
2013-12-18  8:39                                                                   ` Martin Vaeth
2013-11-17 20:13                                   ` modify functions hierarchy (was: Install run-help and *.zwc files system wide in build system) Peter Stephenson
2013-11-17 20:50                                     ` Bart Schaefer
2013-11-18  7:57                                       ` Martin Vaeth
2013-11-18 16:28                                         ` Bart Schaefer
2013-11-18 10:32                                       ` Peter Stephenson
2013-11-18 16:38                                         ` Bart Schaefer
2013-11-18 16:50                                           ` Peter Stephenson
2013-11-12 21:52                     ` Install run-help and *.zwc files system wide in build system Martin Vaeth
2013-11-13  1:13                       ` Bart Schaefer
2013-11-13  2:40                         ` Bart Schaefer
2013-11-13 13:30                 ` [PATCH] helpfiles: Also accept 'UTF-8' as an encoding name Jun T.
2013-11-13 15:37                   ` Jun T.
2013-11-13 16:56                     ` Martin Vaeth
2013-11-13 17:27                       ` Bart Schaefer
2013-11-13 18:28                         ` Martin Vaeth
2013-11-14  0:06                           ` Phil Pennock
2013-11-14  7:50                             ` Martin Vaeth
2013-11-14  8:18                               ` Phil Pennock
2013-11-14 11:11                                 ` Martin Vaeth
2013-11-15 14:58                                   ` Jun T.
2013-11-15 17:16                                     ` Bart Schaefer
2013-11-15 19:58                                     ` Martin Vaeth
2013-11-16  5:51                                       ` Bart Schaefer
2013-11-16 15:17                                         ` Jun T.
2013-11-16 18:05                                           ` Bart Schaefer
2013-11-18 18:43                                       ` Phil Pennock
2013-11-10 22:44   ` Install run-help and *.zwc files system wide in build system Martin Vaeth
2013-11-10 18:56 ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131120192608.3af3b92c@pws-pc.ntlworld.com \
    --to=p.w.stephenson@ntlworld.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).