From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23891 invoked from network); 9 Jul 1999 13:29:38 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 9 Jul 1999 13:29:38 -0000 Received: (qmail 26722 invoked by alias); 9 Jul 1999 13:29:32 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7080 Received: (qmail 26715 invoked from network); 9 Jul 1999 13:29:31 -0000 Message-Id: <9907091300.AA23352@ibmth.df.unipi.it> To: zsh-workers@sunsite.auc.dk (Zsh hackers list) Subject: Re: PATCH: pws-25: old shell functions again In-Reply-To: "Peter Stephenson"'s message of "Fri, 09 Jul 1999 14:25:44 DFT." <9907091225.AA37560@ibmth.df.unipi.it> Date: Fri, 09 Jul 1999 15:00:44 +0200 From: Peter Stephenson 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 Tel: +39 050 844536 WWW: http://www.ifh.de/~pws/ Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy