scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | README | LICENSE

uninstall (484B)


      1 #!/bin/sh
      2 
      3 set -e
      4 
      5 for i
      6 do
      7 	case "$i" in
      8 	-p)
      9 		proto=$2
     10 		shift 2
     11 		;;
     12 	-*)
     13 		echo usage: uninstall [-p proto] prefix >&2
     14 		exit 1
     15 		;;
     16 	esac
     17 done
     18 
     19 prefix=${1?'prefix missed'}
     20 
     21 while read type perm name
     22 do
     23 	case $type in
     24 	d)
     25 		continue
     26 		;;
     27 	f)
     28 		rm -f $prefix/$name
     29 		;;
     30 	*)
     31 		echo install: wrong entry type >&2
     32 		exit 1
     33 		;;
     34 	esac
     35 done < ${proto:-scripts/proto}
     36 
     37 while read type perm name
     38 do
     39 	case $type in
     40 	d)
     41 		rmdir $prefix/$name || :
     42 		;;
     43 	esac
     44 done < ${proto:-scripts/proto}