diff options
author | Tim Smith <tsmith@chef.io> | 2018-10-30 19:09:35 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-30 19:09:35 -0700 |
commit | 778cafa101d9f4c7480aa2c70244cadfcdf4421f (patch) | |
tree | 5872bbd15c2976dc517eabf6e31840caf6f214ef /omnibus | |
parent | 1c658ab8b68d1deace597c91e7eb447807747104 (diff) | |
parent | 0cff92d438dba8900fe9e9360b20bf824d1c978f (diff) | |
download | chef-778cafa101d9f4c7480aa2c70244cadfcdf4421f.tar.gz |
Merge pull request #7819 from chef/sles15_symlinks
Fix testing / installing on SLES 15
Diffstat (limited to 'omnibus')
-rwxr-xr-x | omnibus/package-scripts/angrychef/postrm | 14 | ||||
-rwxr-xr-x | omnibus/package-scripts/chef-fips/postrm | 14 | ||||
-rwxr-xr-x | omnibus/package-scripts/chef/postrm | 14 |
3 files changed, 33 insertions, 9 deletions
diff --git a/omnibus/package-scripts/angrychef/postrm b/omnibus/package-scripts/angrychef/postrm index 247688074e..a153da7102 100755 --- a/omnibus/package-scripts/angrychef/postrm +++ b/omnibus/package-scripts/angrychef/postrm @@ -11,11 +11,19 @@ is_smartos() { uname -v | grep "^joyent" 2>&1 >/dev/null } -is_darwin() -{ +is_darwin() { uname -v | 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_smartos; then PREFIX="/opt/local" elif is_darwin; then @@ -33,7 +41,7 @@ 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 ! -f /etc/SuSE-release ]; then +if [ ! -f /etc/redhat-release -a ! -f /etc/fedora-release -a ! -f /etc/system-release -a ! is_suse ]; then # not a redhat-ish RPM-based system cleanup_symlinks elif [ "x$1" = "x0" ]; then diff --git a/omnibus/package-scripts/chef-fips/postrm b/omnibus/package-scripts/chef-fips/postrm index 247688074e..a153da7102 100755 --- a/omnibus/package-scripts/chef-fips/postrm +++ b/omnibus/package-scripts/chef-fips/postrm @@ -11,11 +11,19 @@ is_smartos() { uname -v | grep "^joyent" 2>&1 >/dev/null } -is_darwin() -{ +is_darwin() { uname -v | 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_smartos; then PREFIX="/opt/local" elif is_darwin; then @@ -33,7 +41,7 @@ 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 ! -f /etc/SuSE-release ]; then +if [ ! -f /etc/redhat-release -a ! -f /etc/fedora-release -a ! -f /etc/system-release -a ! is_suse ]; then # not a redhat-ish RPM-based system cleanup_symlinks elif [ "x$1" = "x0" ]; then diff --git a/omnibus/package-scripts/chef/postrm b/omnibus/package-scripts/chef/postrm index 247688074e..a153da7102 100755 --- a/omnibus/package-scripts/chef/postrm +++ b/omnibus/package-scripts/chef/postrm @@ -11,11 +11,19 @@ is_smartos() { uname -v | grep "^joyent" 2>&1 >/dev/null } -is_darwin() -{ +is_darwin() { uname -v | 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_smartos; then PREFIX="/opt/local" elif is_darwin; then @@ -33,7 +41,7 @@ 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 ! -f /etc/SuSE-release ]; then +if [ ! -f /etc/redhat-release -a ! -f /etc/fedora-release -a ! -f /etc/system-release -a ! is_suse ]; then # not a redhat-ish RPM-based system cleanup_symlinks elif [ "x$1" = "x0" ]; then |