summary refs log tree commit diff
path: root/Config
diff options
context:
space:
mode:
Diffstat (limited to 'Config')
-rwxr-xr-xConfig/installfns.sh13
-rwxr-xr-xConfig/uninstallfns.sh47
2 files changed, 46 insertions, 14 deletions
diff --git a/Config/installfns.sh b/Config/installfns.sh
index 8dc1214b0..83f3cb6c1 100755
--- a/Config/installfns.sh
+++ b/Config/installfns.sh
@@ -1,6 +1,7 @@
 #!/bin/sh
 
 fndir=$DESTDIR$fndir
+scriptdir=$DESTDIR$scriptdir
 
 /bin/sh $sdir_top/mkinstalldirs $fndir || exit 1;
 
@@ -25,13 +26,23 @@ for file in $allfuncs; do
       Completion/*)
         instdir="$fndir/Completion"
         ;;
+      Scripts/*)
+        instdir="$scriptdir"
+	;;
       *)
         subdir="`echo $file | sed -e 's%/[^/]*$%%' -e 's%^Functions/%%'`"
         instdir="$fndir/$subdir"
         ;;
       esac
     else
-      instdir="$fndir"
+      case "$file" in
+      Scripts/*)
+        instdir="$scriptdir"
+	;;
+      *)
+        instdir="$fndir"
+        ;;
+      esac
     fi
     test -d $instdir || /bin/sh $sdir_top/mkinstalldirs $instdir || exit 1
     $INSTALL_DATA $sdir_top/$file $instdir || exit 1
diff --git a/Config/uninstallfns.sh b/Config/uninstallfns.sh
index c45c58b09..7c223889c 100755
--- a/Config/uninstallfns.sh
+++ b/Config/uninstallfns.sh
@@ -1,6 +1,7 @@
 #!/bin/sh
 
 fndir=$DESTDIR$fndir
+scriptdir=$DESTDIR$scriptdir
 
 allfuncs="`grep ' functions=' ${dir_top}/config.modules |
   sed -e '/^#/d' -e '/ link=no/d' -e 's/^.* functions=//'`"
@@ -10,10 +11,6 @@ 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
@@ -22,15 +19,39 @@ case $fndir in
      # 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%%^Functions/%'`
-	   rm -f $fndir/$file;
-	 else
-	   bfile="`echo $file | sed -e 's%^.*/%%'`"
-	   rm -f "$fndir/$bfile"; \
-	 fi
-       fi
+       case $file in
+       Scripts/*)
+	 ;;
+       *)
+         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%%^(Functions|Completion)/%'`
+	     rm -f $fndir/$file
+	   else
+	     bfile="`echo $file | sed -e 's%^.*/%%'`"
+	     rm -f "$fndir/$bfile"
+	   fi
+         fi
+	 ;;
+       esac
+     done
+     ;;
+esac
+
+case $scriptdir in
+  *$VERSION*)
+     # $scriptdir might be the parent of fndir.
+     rm -rf $scriptdir
+     ;;
+  *) for file in $allfuncs; do
+	case $file in
+	Scripts/*)
+	  if test -f $sdir_top/$file; then
+	    bfile="`echo $file | sed -e 's%^.*/%%'`"
+	    rm -f "$scriptdir/$bfile"
+	  fi
+	  ;;
+	esac
      done
      ;;
 esac