summaryrefslogtreecommitdiff
path: root/util/sbase/scripts/uninstall
diff options
context:
space:
mode:
Diffstat (limited to 'util/sbase/scripts/uninstall')
-rwxr-xr-xutil/sbase/scripts/uninstall32
1 files changed, 32 insertions, 0 deletions
diff --git a/util/sbase/scripts/uninstall b/util/sbase/scripts/uninstall
new file mode 100755
index 00000000..e9c74f2d
--- /dev/null
+++ b/util/sbase/scripts/uninstall
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+set -e
+
+while read type src dst perm
+do
+ case $type in
+ d)
+ echo $type $src $dst $perm
+ continue
+ ;;
+ c)
+ rm -f $dst
+ ;;
+ *)
+ echo uninstall: wrong entry type >&2
+ exit 1
+ ;;
+ esac
+done < $1 |
+sort -r |
+while read type src dst perm
+do
+ case $type in
+ d)
+ if test `ls $dst | wc -l` -eq 0
+ then
+ rmdir $dst
+ fi
+ ;;
+ esac
+done