summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--Completion/Makefile.in86
-rw-r--r--Config/funcinst.mk47
-rwxr-xr-xConfig/installfns.sh48
-rwxr-xr-xConfig/uninstallfns.sh59
-rw-r--r--Functions/Makefile.in86
-rw-r--r--Makefile.in23
-rw-r--r--Src/Modules/zftp.mdd1
-rw-r--r--Src/Zle/complete.mdd1
-rw-r--r--Src/Zle/zle.mdd1
-rw-r--r--Src/zsh.mdd1
-rw-r--r--configure.in43
11 files changed, 89 insertions, 307 deletions
diff --git a/Completion/Makefile.in b/Completion/Makefile.in
deleted file mode 100644
index 8b7776a7f..000000000
--- a/Completion/Makefile.in
+++ /dev/null
@@ -1,86 +0,0 @@
-#
-# Makefile for Completion subdirectory
-#
-# Copyright (c) 1999 Peter Stephensons
-# All rights reserved.
-#
-# Permission is hereby granted, without written agreement and without
-# license or royalty fees, to use, copy, modify, and distribute this
-# software and to distribute modified versions of this software for any
-# purpose, provided that the above copyright notice and the following
-# two paragraphs appear in all copies of this software.
-#
-# In no event shall Peter Stephenson or the Zsh Development Group be liable
-# to any party for direct, indirect, special, incidental, or consequential
-# damages arising out of the use of this software and its documentation,
-# even if Peter Stephenson and the Zsh Development Group have been advised of
-# the possibility of such damage.
-#
-# Peter Stephenson and the Zsh Development Group specifically disclaim any
-# warranties, including, but not limited to, the implied warranties of
-# merchantability and fitness for a particular purpose.  The software
-# provided hereunder is on an "as is" basis, and Peter Stephenson and the
-# Zsh Development Group have no obligation to provide maintenance,
-# support, updates, enhancements, or modifications.
-#
-
-subdir = Completion
-dir_top = ..
-SUBDIRS =
-
-@VERSION_MK@
-
-# source/build directories
-VPATH           = @srcdir@
-sdir            = @srcdir@
-sdir_top        = @top_srcdir@
-INSTALL         = @INSTALL@
-
-@DEFS_MK@
-
-# ========== DEPENDENCIES FOR BUILDING ==========
-
-all:
-
-# ========== DEPENDENCIES FOR INSTALLING ==========
-
-install: install.fns
-
-uninstall: uninstall.fns
-
-# install functions, including those in subdirectories, creating
-# install directory if necessary
-install.fns:
-	if test x$(fndir) != x && test x$(fndir) != xno; then \
-	  $(sdir_top)/mkinstalldirs $(fndir) || exit 1; \
-	  for file in $(FUNCTIONS_INSTALL); do \
-	    if test -f $$file; then \
-	      $(INSTALL_DATA) $$file $(fndir) || exit 1; \
-	    fi; \
-	  done; \
-	fi; \
-	exit 0
-
-uninstall.fns:
-	if test x$(fndir) != x && test x$(fndir) != xno; then \
-	  for file in $(FUNCTIONS_INSTALL); do \
-	    if test -f $$file; then \
-	      rm -f "$(fndir)/`echo $$file | sed -e 's%^.*/%%'`"; \
-	    fi; \
-	  done; \
-	fi; \
-	exit 0
-
-# ========== DEPENDENCIES FOR CLEANUP ==========
-
-@CLEAN_MK@
-
-mostlyclean-here:
-
-distclean-here:
-
-realclean-here:
-
-# ========== DEPENDENCIES FOR MAINTENANCE ==========
-
-@CONFIG_MK@
diff --git a/Config/funcinst.mk b/Config/funcinst.mk
deleted file mode 100644
index e473eb351..000000000
--- a/Config/funcinst.mk
+++ /dev/null
@@ -1,47 +0,0 @@
-#
-# Makefile definitions for installing shell functions
-#
-# Copyright (c) 1999 Peter Stephenson
-# All rights reserved.
-#
-# Permission is hereby granted, without written agreement and without
-# license or royalty fees, to use, copy, modify, and distribute this
-# software and to distribute modified versions of this software for any
-# purpose, provided that the above copyright notice and the following
-# two paragraphs appear in all copies of this software.
-#
-# In no event shall Peter Stephenson or the Zsh Development Group be liable
-# to any party for direct, indirect, special, incidental, or consequential
-# damages arising out of the use of this software and its documentation,
-# even if Peter Stephenson and the Zsh Development Group have been advised of
-# the possibility of such damage.
-#
-# Peter Stephenson and the Zsh Development Group specifically disclaim any
-# warranties, including, but not limited to, the implied warranties of
-# merchantability and fitness for a particular purpose.  The software
-# provided hereunder is on an "as is" basis, and Peter Stephenson and the
-# Zsh Development Group have no obligation to provide maintenance,
-# support, updates, enhancements, or modifications.
-#
-
-# install functions, including those in subdirectories, creating
-# install directory if necessary
-
-install.fns:
-	if test x$(fndir) != x && test x$(fndir) != xno; then \
-	  sdir_top="$(sdir_top)" fndir="$(fndir)" sdir="$(sdir)" \
-	  FUNCTIONS_INSTALL="$(FUNCTIONS_INSTALL)" \
-	  FUNCTIONS_SUBDIRS="$(FUNCTIONS_SUBDIRS)" \
-	  INSTALL_DATA="$(INSTALL_DATA)" \
-	  $(SHELL) $(sdir_top)/Config/installfns.sh || exit 1; \
-	fi; \
-	exit 0
-
-uninstall.fns:
-	if test x$(fndir) != x && test x$(fndir) != xno; then \
-	  fndir="$(fndir)" sdir="$(sdir)" \
-	  FUNCTIONS_INSTALL="$(FUNCTIONS_INSTALL)" \
-	  FUNCTIONS_SUBDIRS="$(FUNCTIONS_SUBDIRS)" \
-	  $(SHELL) $(sdir_top)/Config/uninstallfns.sh || exit 1; \
-	fi; \
-	exit 0
diff --git a/Config/installfns.sh b/Config/installfns.sh
index de7a52bce..eb552b76d 100755
--- a/Config/installfns.sh
+++ b/Config/installfns.sh
@@ -1,48 +1,26 @@
 #!/bin/sh
 
-if test -d $fndir.old; then
-  add_old=1
-fi
+fndir=$DESTDIR$fndir
 
 $sdir_top/mkinstalldirs $fndir || exit 1;
 
-# If the source directory is somewhere else, we need to force
-# the shell to expand it in that directory, then strip it off.
-install=
-for file in $FUNCTIONS_INSTALL; do
-  if test -f "$sdir/$file"; then
-    install="$install $file"
-  else
-    install="$install `echo $sdir/$file | sed -e \"s%$sdir/%%g\"`"
-  fi
-done
+allfuncs="`grep ' functions=' ${dir_top}/config.modules |
+  sed -e '/^#/d' -e '/ link=no/d' -e 's/^.* functions=//'`"
+
+allfuncs="`cd $sdir_top; echo ${allfuncs}`"
 
-for file in $install; do
-  if test -f $sdir/$file; then
+# 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
+  if test -f $sdir_top/$file; then
     if test x$FUNCTIONS_SUBDIRS != x -a x$FUNCTIONS_SUBDIRS != xno; then
-      subfile="$file"
-      subdir="`echo $file | sed -e 's%/[^/]*$%%'`"
-      olddir="$fndir.old/$subdir"
+      subdir="`echo $file | sed -e 's%/[^/]*$%%' \
+		-e s%^Functions/%% -e s%^Completion/%%`"
       instdir="$fndir/$subdir"
     else
-      subfile="`echo $file | sed -e 's%^.*/%%'`"
-      olddir="$fndir.old"
       instdir="$fndir"
     fi
-    if test -f $fndir/$subfile; then
-      if cmp $fndir/$subfile $sdir/$file >/dev/null; then :; else
-	$sdir_top/mkinstalldirs $olddir
-        mv $fndir/$subfile $olddir
-        : ${add_old:=1}
-      fi
-    fi
-    $sdir_top/mkinstalldirs $instdir || exit 1
-    $INSTALL_DATA $sdir/$file $instdir || exit 1
+    test -d $instdir || $sdir_top/mkinstalldirs $instdir || exit 1
+    $INSTALL_DATA $sdir_top/$file $instdir || exit 1
   fi
 done
-
-if test x$add_old != x1; then
-  rm -rf $fndir.old
-fi
-
-exit 0
diff --git a/Config/uninstallfns.sh b/Config/uninstallfns.sh
index ae1b4fef5..963daad66 100755
--- a/Config/uninstallfns.sh
+++ b/Config/uninstallfns.sh
@@ -1,31 +1,38 @@
 #!/bin/sh
 
-# If the source directory is somewhere else, we need to force
-# the shell to expand it in that directory, then strip it off.
-install=
-for file in $FUNCTIONS_INSTALL; do
-  if test -f "$sdir/$file"; then
-    install="$install $file"
-  else
-    install="$install `echo $sdir/$file | sed -e \"s%$sdir/%%g\"`"
-  fi
-done
+fndir=$DESTDIR$fndir
 
-for file in $install; do
-  if test -f $sdir/$file; then
-    if test x$FUNCTIONS_SUBDIRS != x -a x$FUNCTIONS_SUBDIRS != xno; then
-      rm -f $fndir/$file;
-      if test -f $fndir.old/$file; then
-	mv $fndir.old/$file $fndir/$file
-      fi
-    else
-      bfile="`echo $file | sed -e 's%^.*/%%'`"
-      rm -f "$fndir/$bfile"; \
-      if test -f $fndir.old/$bfile; then
-        mv $fndir.old/$bfile $fndir/$bfile
-      fi
-    fi
-  fi
-done
+allfuncs="`grep ' functions=' ${dir_top}/config.modules |
+  sed -e '/^#/d' -e '/ link=no/d' -e 's/^.* functions=//'`"
+
+allfuncs="`cd ${sdir_top}; echo ${allfuncs}`"
+
+case $fndir in
+  *$VERSION*)
+     # Version specific function directory, safe to remove completely.
+     # However, we don't remove the top-level version directory since
+     # it could have other things than functions in it.  We could
+     # do that instead in the top-level Makefile on a full uninstall,
+     # if we wanted.
+     rm -rf $fndir
+     ;;
+  *) # The following will only apply with a custom install directory
+     # with no version information.  This is rather undesirable.
+     # But let's try and do the best we can.
+     # 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
+       if test -f $sdir_top/$file; then
+	 if test x$FUNCTIONS_SUBDIRS != x -a x$FUNCTIONS_SUBDIRS != xno; then
+	   file=`echo $file | sed -e 's%%^Completion/%' -e 's%%^Functions%'`
+	   rm -f $fndir/$file;
+	 else
+	   bfile="`echo $file | sed -e 's%^.*/%%'`"
+	   rm -f "$fndir/$bfile"; \
+	 fi
+       fi
+     done
+     ;;
+esac
 
 exit 0
diff --git a/Functions/Makefile.in b/Functions/Makefile.in
deleted file mode 100644
index d6344dd62..000000000
--- a/Functions/Makefile.in
+++ /dev/null
@@ -1,86 +0,0 @@
-#
-# Makefile for Functions subdirectory
-#
-# Copyright (c) 1999 Peter Stephensons
-# All rights reserved.
-#
-# Permission is hereby granted, without written agreement and without
-# license or royalty fees, to use, copy, modify, and distribute this
-# software and to distribute modified versions of this software for any
-# purpose, provided that the above copyright notice and the following
-# two paragraphs appear in all copies of this software.
-#
-# In no event shall Peter Stephenson or the Zsh Development Group be liable
-# to any party for direct, indirect, special, incidental, or consequential
-# damages arising out of the use of this software and its documentation,
-# even if Peter Stephenson and the Zsh Development Group have been advised of
-# the possibility of such damage.
-#
-# Peter Stephenson and the Zsh Development Group specifically disclaim any
-# warranties, including, but not limited to, the implied warranties of
-# merchantability and fitness for a particular purpose.  The software
-# provided hereunder is on an "as is" basis, and Peter Stephenson and the
-# Zsh Development Group have no obligation to provide maintenance,
-# support, updates, enhancements, or modifications.
-#
-
-subdir = Functions
-dir_top = ..
-SUBDIRS =
-
-@VERSION_MK@
-
-# source/build directories
-VPATH           = @srcdir@
-sdir            = @srcdir@
-sdir_top        = @top_srcdir@
-INSTALL         = @INSTALL@
-
-@DEFS_MK@
-
-# ========== DEPENDENCIES FOR BUILDING ==========
-
-all:
-
-# ========== DEPENDENCIES FOR INSTALLING ==========
-
-install: install.fns
-
-uninstall: uninstall.fns
-
-# install functions, including those in subdirectories, creating
-# install directory if necessary
-install.fns:
-	if test x$(fndir) != x && test x$(fndir) != xno; then \
-	  $(sdir_top)/mkinstalldirs $(fndir) || exit 1; \
-	  for file in $(FUNCTIONS_INSTALL); do \
-	    if test -f $$file; then \
-	      $(INSTALL_DATA) $$file $(fndir) || exit 1; \
-	    fi; \
-	  done; \
-	fi; \
-	exit 0
-
-uninstall.fns:
-	if test x$(fndir) != x && test x$(fndir) != xno; then \
-	  for file in $(FUNCTIONS_INSTALL); do \
-	    if test -f $$file; then \
-	      rm -f "$(fndir)/`echo $$file | sed -e 's%^.*/%%'`"; \
-	    fi; \
-	  done; \
-	fi; \
-	exit 0
-
-# ========== DEPENDENCIES FOR CLEANUP ==========
-
-@CLEAN_MK@
-
-mostlyclean-here:
-
-distclean-here:
-
-realclean-here:
-
-# ========== DEPENDENCIES FOR MAINTENANCE ==========
-
-@CONFIG_MK@
diff --git a/Makefile.in b/Makefile.in
index 5882ce42c..cb1d14be2 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -77,14 +77,25 @@ install.man uninstall.man:
 
 # install/uninstall just the shell functions
 install.fns:
-	test x$(sitefndir) != xno && $(sdir_top)/mkinstalldirs $(DESTDIR)$(sitefndir)
-	@cd Completion && $(MAKE) $(MAKEDEFS) $@
-	@cd Functions && $(MAKE) $(MAKEDEFS) $@
+	if test x$(fndir) != x && test x$(fndir) != xno; then \
+	  test x$(sitefndir) != xno && \
+	    $(sdir_top)/mkinstalldirs $(DESTDIR)$(sitefndir); \
+	  sdir_top="$(sdir_top)" fndir="$(fndir)" dir_top="$(dir_top)" \
+	  FUNCTIONS_SUBDIRS="$(FUNCTIONS_SUBDIRS)" \
+	  INSTALL_DATA="$(INSTALL_DATA)" \
+	  DESTDIR="$(DESTDIR)" VERSION="$(VERSION)" \
+	  $(SHELL) $(sdir_top)/Config/installfns.sh || exit 1; \
+	fi; \
+	exit 0
 
 uninstall.fns:
-	# never attempt to remove $(sitefndir)
-	@cd Completion && $(MAKE) $(MAKEDEFS) $@
-	@cd Functions && $(MAKE) $(MAKEDEFS) $@
+	if test x$(fndir) != x && test x$(fndir) != xno; then \
+	  fndir="$(fndir)" dir_top="$(dir_top)" \
+	  FUNCTIONS_SUBDIRS="$(FUNCTIONS_SUBDIRS)" \
+	  DESTDIR="$(DESTDIR)" VERSION="$(VERSION)" \
+	  $(SHELL) $(sdir_top)/Config/uninstallfns.sh || exit 1; \
+	fi; \
+	exit 0
 
 # install/uninstall just the info pages
 install.info uninstall.info:
diff --git a/Src/Modules/zftp.mdd b/Src/Modules/zftp.mdd
index e295f254a..d9619b549 100644
--- a/Src/Modules/zftp.mdd
+++ b/Src/Modules/zftp.mdd
@@ -1,6 +1,7 @@
 name=zsh/zftp
 link=dynamic
 load=no
+functions='Functions/Zftp/*'
 
 autobins="zftp"
 
diff --git a/Src/Zle/complete.mdd b/Src/Zle/complete.mdd
index a8ed9a484..95c6e99a0 100644
--- a/Src/Zle/complete.mdd
+++ b/Src/Zle/complete.mdd
@@ -1,6 +1,7 @@
 name=zsh/complete
 link=either
 load=yes
+functions='Completion/Core/* Completion/Base/* Completion/Builtins/* Completion/User/* Completion/Commands/* Completion/Debian/* Completion/Linux/* Completion/Bsd/* Completion/AIX/* Completion/X/*'
 
 moddeps="zsh/zle"
 
diff --git a/Src/Zle/zle.mdd b/Src/Zle/zle.mdd
index c5675cb03..9981cec90 100644
--- a/Src/Zle/zle.mdd
+++ b/Src/Zle/zle.mdd
@@ -1,6 +1,7 @@
 name=zsh/zle
 link=either
 load=yes
+functions='Functions/Zle/*'
 
 autobins="bindkey vared zle"
 
diff --git a/Src/zsh.mdd b/Src/zsh.mdd
index 56cd081e8..72db7e059 100644
--- a/Src/zsh.mdd
+++ b/Src/zsh.mdd
@@ -2,6 +2,7 @@ name=zsh/main
 link=static
 load=yes
 # load=static should replace use of alwayslink
+functions='Functions/Misc/* Functions/Prompts/*'
 
 nozshdep=1
 alwayslink=1
diff --git a/configure.in b/configure.in
index 651d13ca4..9202c6216 100644
--- a/configure.in
+++ b/configure.in
@@ -236,16 +236,8 @@ undefine([function_subdirs])
 AC_ARG_ENABLE(function-subdirs,
 [  --enable-function-subdirs  install functions in subdirectories])
 
-if test "x${FUNCTIONS_INSTALL+set}" != xset; then
-  FUNCTIONS_INSTALL="Core/* Base/* Builtins/* User/* Commands/* Debian/* Linux/* Bsd/* AIX/* X/* Zle/* Prompts/* Misc/*"
-  if test $dynamic != no; then
-    FUNCTIONS_INSTALL="${FUNCTIONS_INSTALL} Zftp/*"
-  fi
-fi
-
 if test "x${enable_function_subdirs}" != x -a \
-  "x${enable_function_subdirs}" != xno -a \
-  "x$FUNCTIONS_INSTALL" != x; then
+  "x${enable_function_subdirs}" != xno; then
   FUNCTIONS_SUBDIRS=yes
 else
   FUNCTIONS_SUBDIRS=no
@@ -253,7 +245,6 @@ fi
 
 AC_SUBST(fndir)dnl
 AC_SUBST(sitefndir)dnl
-AC_SUBST(FUNCTIONS_INSTALL)dnl
 AC_SUBST(FUNCTIONS_SUBDIRS)dnl
 
 dnl Do you want maildir support?
@@ -1733,15 +1724,19 @@ echo "# Values of \`auto' are \`yes' or \`no'. configure sets the value to"
 echo "# \`yes'.  If you set it by hand to \`no', the line will be retained"
 echo "# when the file is regenerated in future."
 echo "#"
+echo "# Note that the \`functions' entry extends to the end of the line."
+echo "# It should not be quoted; it is used verbatim to find files to install."
+echo "#"
 echo "# You will need to run \`config.status --recheck' if you add a new"
 echo "# module."
 echo "#"
 echo "# You should not change the values for the pseudo-module zsh/main,"
-echo "# which is the main shell."
+echo "# which is the main shell (apart from the functions entry)."
 for modfile in `cd ${srcdir}; echo */*.mdd */*/*.mdd`; do
   name=
   link=
   load=
+  functions=
   . ${srcdir}/$modfile
   if test x$name != x -a x"$link" != x; then
     case "$userlist" in
@@ -1758,26 +1753,32 @@ for modfile in `cd ${srcdir}; echo */*.mdd */*/*.mdd`; do
 	 *) load=" load=no"
 	    ;;
        esac
+       if test "x$functions" != x; then
+         # N.B. no additional quotes
+         f=" functions=$functions"
+       else
+         f=
+       fi
        case "$link" in
-	 static) echo "name=$name modfile=$modfile link=static auto=yes${load}"
+	 static) echo "name=$name modfile=$modfile link=static auto=yes${load}$f"
 	         ;;
 	 dynamic) if test $dynamic != no; then
 		    echo "name=$name modfile=$modfile link=dynamic\
- auto=yes${load}"
+ auto=yes${load}$f"
 		  else
 		    echo "name=$name modfile=$modfile link=no\
- auto=yes load=no"
+ auto=yes load=no$f"
 		  fi
 		  ;;
 	 either) if test $dynamic != no; then
 		   echo "name=$name modfile=$modfile link=dynamic\
- auto=yes${load}"
+ auto=yes${load}$f"
 		 else
 		   echo "name=$name modfile=$modfile link=static\
- auto=yes${load}"
+ auto=yes${load}$f"
 		 fi
 		 ;;
-	      *) echo "name=$name modfile=$modfile link=no auto=yes load=no"
+	      *) echo "name=$name modfile=$modfile link=no auto=yes load=no$f"
 		 ;;
        esac
        ;;
@@ -1803,7 +1804,7 @@ real_no_create=$no_create
 no_create=yes
 
 AC_OUTPUT(Config/defs.mk Makefile Doc/Makefile Etc/Makefile Src/Makefile \
-Test/Makefile Completion/Makefile Functions/Makefile, \
+Test/Makefile, \
 [test -z "$CONFIG_HEADERS" || echo > stamp-h])
 
 dnl The standard config.status is missing some essential features.
@@ -1848,7 +1849,7 @@ binary install path       : ${zshbin2}
 man page install path     : ${zshman}
 info install path         : ${zshinfo}"
 if test "$zshfndir" != no; then
-echo "functions install path    : ${zshfndir}
-installed functions       : ${FUNCTIONS_INSTALL}
-"
+  echo "functions install path    : ${zshfndir}"
 fi
+echo "See config.modules for installed modules and functions.
+"