aboutsummaryrefslogtreecommitdiffstats
path: root/shells/heirloom-sh/pkg-deinstall
diff options
context:
space:
mode:
authormiwi <miwi@FreeBSD.org>2008-04-30 05:34:02 +0800
committermiwi <miwi@FreeBSD.org>2008-04-30 05:34:02 +0800
commit3e51980ec4b946aff4aec37aca6cee75ff5a4103 (patch)
tree228bdef064b396b63997c9e585d782cd334e784f /shells/heirloom-sh/pkg-deinstall
parenta4ccdc92b0a531144032beac09559d5a3f5b0068 (diff)
downloadfreebsd-ports-gnome-3e51980ec4b946aff4aec37aca6cee75ff5a4103.tar.gz
freebsd-ports-gnome-3e51980ec4b946aff4aec37aca6cee75ff5a4103.tar.zst
freebsd-ports-gnome-3e51980ec4b946aff4aec37aca6cee75ff5a4103.zip
Heirloom-sh is a portable version of OpenSolaris' #!/bin/sh.
If one need to write portable shell scripts, this one is excellent for testing them. It is installed as jsh (job shell). Other OpenSolaris user land tools are available in sysutils/heirloom WWW: http://heirloom.sourceforge.net/sh.html PR: ports/122192 Submitted by: Danijel Tasov <danielt at pilgerer.org>
Diffstat (limited to 'shells/heirloom-sh/pkg-deinstall')
-rw-r--r--shells/heirloom-sh/pkg-deinstall22
1 files changed, 22 insertions, 0 deletions
diff --git a/shells/heirloom-sh/pkg-deinstall b/shells/heirloom-sh/pkg-deinstall
new file mode 100644
index 000000000000..439041a4af1b
--- /dev/null
+++ b/shells/heirloom-sh/pkg-deinstall
@@ -0,0 +1,22 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+JSH="$(echo ${PKG_PREFIX-/usr/local}/bin/jsh | /usr/bin/sed -e 's|//|/|g')"
+SHELLS="${PKG_DESTDIR-}/etc/shells"
+
+case $2 in
+DEINSTALL)
+ if grep -qs "^$JSH\$" "$SHELLS"; then
+ if [ $(id -u) -eq 0 ]; then
+ TMPSHELLS=$(mktemp -t shells)
+ grep -v "^$JSH\$" "$SHELLS" > "$TMPSHELLS"
+ cat "$TMPSHELLS" > "$SHELLS"
+ rm "$TMPSHELLS"
+ else
+ echo "Not root, please remove $JSH from $SHELLS manually"
+ fi
+ fi
+ ;;
+esac