zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: [3.1.6-pws-3] fix use of DESTDIR in fns
@ 1999-09-07 22:24 Clint Adams
  1999-09-07 23:03 ` Bart Schaefer
  0 siblings, 1 reply; 2+ messages in thread
From: Clint Adams @ 1999-09-07 22:24 UTC (permalink / raw)
  To: zsh-workers

--- zsh-3.1.6.pws3.orig/Config/installfns.sh
+++ zsh-3.1.6.pws3/Config/installfns.sh
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-if test -d $fndir.old; then
+if test -d $DESTDIR$fndir.old; then
   add_old=1
 fi
 
@@ -22,27 +22,27 @@
     if test x$FUNCTIONS_SUBDIRS != x -a x$FUNCTIONS_SUBDIRS != xno; then
       subfile="$file"
       subdir="`echo $file | sed -e 's%/[^/]*$%%'`"
-      olddir="$fndir.old/$subdir"
-      instdir="$fndir/$subdir"
+      olddir="$DESTDIR$fndir.old/$subdir"
+      instdir="$DESTDIR$fndir/$subdir"
     else
       subfile="`echo $file | sed -e 's%^.*/%%'`"
-      olddir="$fndir.old"
-      instdir="$fndir"
+      olddir="$DESTDIR$fndir.old"
+      instdir="$DESTDIR$fndir"
     fi
-    if test -f $fndir/$subfile; then
-      if cmp $fndir/$subfile $sdir/$file >/dev/null; then :; else
+    if test -f $DESTDIR$fndir/$subfile; then
+      if cmp $DESTDIR$fndir/$subfile $sdir/$file >/dev/null; then :; else
 	$sdir_top/mkinstalldirs $olddir
-        mv $fndir/$subfile $olddir
+        mv $DESTDIR$fndir/$subfile $olddir
         : ${add_old:=1}
       fi
     fi
-    $sdir_top/mkinstalldirs $DESTDIR$instdir || exit 1
-    $INSTALL_DATA $sdir/$file $DESTDIR$instdir || exit 1
+    $sdir_top/mkinstalldirs $instdir || exit 1
+    $INSTALL_DATA $sdir/$file $instdir || exit 1
   fi
 done
 
 if test x$add_old != x1; then
-  rm -rf $fndir.old
+  rm -rf $DESTDIR$fndir.old
 fi
 
 exit 0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: PATCH: [3.1.6-pws-3] fix use of DESTDIR in fns
  1999-09-07 22:24 PATCH: [3.1.6-pws-3] fix use of DESTDIR in fns Clint Adams
@ 1999-09-07 23:03 ` Bart Schaefer
  0 siblings, 0 replies; 2+ messages in thread
From: Bart Schaefer @ 1999-09-07 23:03 UTC (permalink / raw)
  To: zsh-workers

On Sep 7,  6:24pm, Clint Adams wrote:

> +      olddir="$DESTDIR$fndir.old/$subdir"
> +      instdir="$DESTDIR$fndir/$subdir"

> +      olddir="$DESTDIR$fndir.old"
> +      instdir="$DESTDIR$fndir"

Etc. etc.

This is getting out of hand.  Whatever happened to factoring?

Index: Config/installfns.sh
===================================================================
RCS file: /extra/cvsroot/zsh/zsh-3.1/Config/installfns.sh,v
retrieving revision 1.5
diff -u -r1.5 installfns.sh
--- installfns.sh	1999/09/07 22:48:46	1.5
+++ installfns.sh	1999/09/07 23:00:15
@@ -1,10 +1,12 @@
 #!/bin/sh
 
-if test -d $DESTDIR$fndir.old; then
+fndir=$DESTDIR$fndir
+
+if test -d $fndir.old; then
   add_old=1
 fi
 
-$sdir_top/mkinstalldirs $DESTDIR$fndir || exit 1;
+$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.
@@ -22,17 +24,17 @@
     if test x$FUNCTIONS_SUBDIRS != x -a x$FUNCTIONS_SUBDIRS != xno; then
       subfile="$file"
       subdir="`echo $file | sed -e 's%/[^/]*$%%'`"
-      olddir="$DESTDIR$fndir.old/$subdir"
-      instdir="$DESTDIR$fndir/$subdir"
+      olddir="$fndir.old/$subdir"
+      instdir="$fndir/$subdir"
     else
       subfile="`echo $file | sed -e 's%^.*/%%'`"
-      olddir="$DESTDIR$fndir.old"
-      instdir="$DESTDIR$fndir"
+      olddir="$fndir.old"
+      instdir="$fndir"
     fi
-    if test -f $DESTDIR$fndir/$subfile; then
-      if cmp $DESTDIR$fndir/$subfile $sdir/$file >/dev/null; then :; else
+    if test -f $fndir/$subfile; then
+      if cmp $fndir/$subfile $sdir/$file >/dev/null; then :; else
 	$sdir_top/mkinstalldirs $olddir
-        mv $DESTDIR$fndir/$subfile $olddir
+        mv $fndir/$subfile $olddir
         : ${add_old:=1}
       fi
     fi
@@ -42,7 +44,7 @@
 done
 
 if test x$add_old != x1; then
-  rm -rf $DESTDIR$fndir.old
+  rm -rf $fndir.old
 fi
 
 exit 0
Index: Config/uninstallfns.sh
===================================================================
RCS file: /extra/cvsroot/zsh/zsh-3.1/Config/uninstallfns.sh,v
retrieving revision 1.3
diff -u -r1.3 uninstallfns.sh
--- uninstallfns.sh	1999/09/01 18:04:00	1.3
+++ uninstallfns.sh	1999/09/07 23:00:15
@@ -11,18 +11,20 @@
   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 $DESTDIR$fndir/$file;
-      if test -f $DESTDIR$fndir.old/$file; then
-	mv $DESTDIR$fndir.old/$file $DESTDIR$fndir/$file
+      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 "$DESTDIR$fndir/$bfile"; \
-      if test -f $DESTDIR$fndir.old/$bfile; then
-        mv $DESTDIR$fndir.old/$bfile $DESTDIR$fndir/$bfile
+      rm -f "$fndir/$bfile"; \
+      if test -f $fndir.old/$bfile; then
+        mv $fndir.old/$bfile $fndir/$bfile
       fi
     fi
   fi


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1999-09-07 23:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-09-07 22:24 PATCH: [3.1.6-pws-3] fix use of DESTDIR in fns Clint Adams
1999-09-07 23:03 ` Bart Schaefer

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