summaryrefslogtreecommitdiff
path: root/Makeuninstall.rc
diff options
context:
space:
mode:
authorHayden Hamilton <hayden@hhvn.uk>2026-05-24 13:48:38 +0100
committerHayden Hamilton <hayden@hhvn.uk>2026-05-24 13:48:38 +0100
commit216202e2cdff9623f815ac998c1b865168ff1583 (patch)
tree6cda9109acde91e328348743b76fe816e185cdd4 /Makeuninstall.rc
Tracked install/uninstall/clean of scripts
Diffstat (limited to 'Makeuninstall.rc')
-rwxr-xr-xMakeuninstall.rc30
1 files changed, 30 insertions, 0 deletions
diff --git a/Makeuninstall.rc b/Makeuninstall.rc
new file mode 100755
index 0000000..5ee5003
--- /dev/null
+++ b/Makeuninstall.rc
@@ -0,0 +1,30 @@
+#!/bin/rc
+
+# This script will uninstall all scripts/dirs copied into $1
+# It uses rmdir(1) to prevent removal of any files from elsewhere
+
+bin = $1
+
+if (test -f .installed) {
+ installed = `$nl{cat .installed}
+ for (s in $installed) {
+ echo RM $bin/$s
+ rm $bin/$s
+ removed = ($removed $bin/$s)
+ }
+ rm .installed
+}
+
+if (test -f .dirsmade) {
+ dirsmade = `$nl{cat .dirsmade}
+ for (d in $dirsmade) {
+ echo RMDIR $bin/$d
+ rmdir $bin/$d
+ removed = ($removed $bin/$s)
+ }
+ rm .dirsmade
+}
+
+if (~ $removed ()) {
+ echo nothing to remove
+}