summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2021-03-09 17:23:12 -0800
committerTim Smith <tsmith84@gmail.com>2021-03-09 17:23:12 -0800
commitb6d8845f4184af600afeb83adee7ac9e134e4b4f (patch)
treec45f83695bf34842d472efb828a6ed0e8673eb59
parent06c4c975bca9a318c716c2c6aaaa4170ad68a3b3 (diff)
downloadchef-b6d8845f4184af600afeb83adee7ac9e134e4b4f.tar.gz
Simplify the logic in the postrm scriptsimplify_uninstall
/etc/os-release tells us we're on Linux 99% of the time now. Fedora is always /etc/os-release so remove fedora-release and system-release Signed-off-by: Tim Smith <tsmith@chef.io>
-rwxr-xr-xomnibus/package-scripts/angrychef/postrm12
1 files changed, 2 insertions, 10 deletions
diff --git a/omnibus/package-scripts/angrychef/postrm b/omnibus/package-scripts/angrychef/postrm
index 43b5f22c98..8528d817a5 100755
--- a/omnibus/package-scripts/angrychef/postrm
+++ b/omnibus/package-scripts/angrychef/postrm
@@ -11,15 +11,6 @@ is_darwin() {
uname -a | grep "^Darwin" 2>&1 >/dev/null
}
-is_suse() {
- if [ -f /etc/os-release ]; then
- . /etc/os-release
- [ "$ID_LIKE" = "sles" ] || [ "$ID_LIKE" = "suse" ]
- else
- [ -f /etc/SuSE-release ]
- fi
-}
-
if is_darwin; then
PREFIX="/usr/local"
else
@@ -35,7 +26,8 @@ cleanup_symlinks() {
# Clean up binary symlinks if they exist
# see: http://tickets.opscode.com/browse/CHEF-3022
-if [ ! -f /etc/redhat-release -a ! -f /etc/fedora-release -a ! -f /etc/system-release -a ! is_suse ]; then
+# NOTE: Once we drop support for all non-systemd distros this can just be a check for /etc/os-release
+if [ ! -f /etc/os-release -a ! -f /etc/redhat-release -a ! -f /etc/SuSE-release ]; then
# not a redhat-ish RPM-based system
cleanup_symlinks
elif [ "x$1" = "x0" ]; then