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

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



You wouldn't believe how much fantastic fun this all is.  Not only did
installation fail when using VPATH (because files in shell functions don't
use that, of course), the .old directory got deleted too early because I
forgot it had to be there for two different Makefiles.

--- Config/funcinst.mk.fi2	Fri Jul  9 14:23:09 1999
+++ Config/funcinst.mk	Fri Jul  9 14:50:08 1999
@@ -29,7 +29,7 @@
 
 install.fns:
 	if test x$(fndir) != x && test x$(fndir) != xno; then \
-	  sdir_top="$(sdir_top)" fndir="$(fndir)" \
+	  sdir_top="$(sdir_top)" fndir="$(fndir)" sdir="$(sdir)" \
 	  FUNCTIONS_INSTALL="$(FUNCTIONS_INSTALL)" \
 	  FUNCTIONS_SUBDIRS="$(FUNCTIONS_SUBDIRS)" \
 	  INSTALL_DATA="$(INSTALL_DATA)" \
@@ -39,7 +39,7 @@
 
 uninstall.fns:
 	if test x$(fndir) != x && test x$(fndir) != xno; then \
-	  fndir="$(fndir)" \
+	  fndir="$(fndir)" sdir="$(sdir)" \
 	  FUNCTIONS_INSTALL="$(FUNCTIONS_INSTALL)" \
 	  FUNCTIONS_SUBDIRS="$(FUNCTIONS_SUBDIRS)" \
 	  $(SHELL) $(sdir_top)/Config/uninstallfns.sh || exit 1; \
--- Config/installfns.sh.fi2	Fri Jul  9 13:52:28 1999
+++ Config/installfns.sh	Fri Jul  9 14:51:48 1999
@@ -7,7 +7,7 @@
 $sdir_top/mkinstalldirs $fndir || exit 1;
 
 for file in $FUNCTIONS_INSTALL; do
-  if test -f $file; then
+  if test -f $sdir/$file; then
     if test x$FUNCTIONS_SUBDIRS != x -a x$FUNCTIONS_SUBDIRS != xno; then
       subfile="$file"
       subdir="`echo $file | sed -e 's%/[^/]*$%%'`"
@@ -19,14 +19,14 @@
       instdir="$fndir"
     fi
     if test -f $fndir/$subfile; then
-      if cmp $fndir/$subfile $file >/dev/null; then :; else
+      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 $file $instdir || exit 1
+    $INSTALL_DATA $sdir/$file $instdir || exit 1
   fi
 done
 
--- Config/uninstallfns.sh.fi2	Fri Jul  9 13:58:05 1999
+++ Config/uninstallfns.sh	Fri Jul  9 14:54:51 1999
@@ -1,26 +1,20 @@
 #!/bin/sh
 
 for file in $FUNCTIONS_INSTALL; do
-  if test -f $file; then
+  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
-      rm -f "$fndir/`echo $file | sed -e 's%^.*/%%'`"; \
+      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
-
-if test -d $fndir.old; then
-  for f in $fndir.old/*; do
-    if test -d $f; then
-      for f2 in $f/*; do
-	mv $f2 $fndir/"`echo $f | sed -e 's%^.*/%%'`"
-      done
-    else
-      mv $f $fndir
-    fi
-  done
-  rm -rf $fndir.old
-fi
 
 exit 0

-- 
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