File: uninstallfns.sh

package info (click to toggle)
zsh-beta 4.3.0-dev-1%2B20050424-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 18,240 kB
  • ctags: 6,564
  • sloc: ansic: 79,241; sh: 4,874; perl: 748; makefile: 676; awk: 341; sed: 16
file content (38 lines) | stat: -rwxr-xr-x 1,220 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/sh

fndir=$DESTDIR$fndir

allfuncs="`grep ' functions=' ${dir_top}/config.modules |
  sed -e '/^#/d' -e '/ link=no/d' -e 's/^.* functions=//'`"

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
     # with no version information.  This is rather undesirable.
     # But let's try and do the best we can.
     # 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
     done
     ;;
esac

exit 0