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

Re: PATCH: pws-25: old shell functions again



Peter Stephenson wrote:
> You wouldn't believe how much fantastic fun this all is.

This time, the problem is that the globbing patterns don't get expanded
until too late if the functions are living in the original source tree.

--- Config/installfns.sh.yetagain	Fri Jul  9 14:51:48 1999
+++ Config/installfns.sh	Fri Jul  9 18:19:56 1999
@@ -6,7 +6,18 @@
 
 $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
+
+for file in $install; do
   if test -f $sdir/$file; then
     if test x$FUNCTIONS_SUBDIRS != x -a x$FUNCTIONS_SUBDIRS != xno; then
       subfile="$file"
--- Config/uninstallfns.sh.yetagain	Fri Jul  9 15:00:32 1999
+++ Config/uninstallfns.sh	Fri Jul  9 18:20:17 1999
@@ -1,6 +1,17 @@
 #!/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
+
+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;

-- 
Peter Stephenson <pws@xxxxxxxxxxxxxxxxx>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy



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