Skip to content

Instantly share code, notes, and snippets.

@akiernan
Created October 20, 2017 20:37
Show Gist options
  • Save akiernan/e6de1c5882bf22e6ce8a20e848a958ca to your computer and use it in GitHub Desktop.
Save akiernan/e6de1c5882bf22e6ce8a20e848a958ca to your computer and use it in GitHub Desktop.
--- install.orig 2017-10-20 19:18:57.240322615 +0000
+++ install 2017-10-20 19:37:55.853078427 +0000
@@ -86,7 +86,7 @@
end
def supported_ruby_versions
- ['2.3', '2.2', '2.1', '2.0']
+ ['2.4', '2.3', '2.2', '2.1', '2.0']
end
# check ruby version, only version 2.x works
@@ -311,6 +311,7 @@
@log.info('Attempting to automatically detect supported package manager type for system...')
has_yum = run_command('which yum >/dev/null 2>/dev/null')
+ has_dnf = run_command('which dnf >/dev/null 2>/dev/null')
has_apt_get = run_command('which apt-get >/dev/null 2>/dev/null')
has_gdebi = run_command('which gdebi >/dev/null 2>/dev/null')
has_zypper = run_command('which zypper >/dev/null 2>/dev/null')
@@ -320,7 +321,7 @@
exit(1)
end
- if(has_yum)
+ if(has_yum || has_dnf)
@type = 'rpm'
elsif(has_zypper)
@type = 'zypper'
@@ -356,7 +357,7 @@
@log.info('Running version matches target version, skipping install')
else
#use -y to answer yes to confirmation prompts
- install_cmd = ['/usr/bin/yum', '-y', 'localinstall']
+ install_cmd = [has_dnf ? '/usr/bin/dnf' : '/usr/bin/yum', '-y', 'localinstall']
install_from_s3(region, bucket, version_file_key, @type, install_cmd)
do_sanity_check('/sbin/service')
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment