Skip to content

Instantly share code, notes, and snippets.

@marcparadise
Created December 14, 2011 21:51
Show Gist options
  • Save marcparadise/1478720 to your computer and use it in GitHub Desktop.
Save marcparadise/1478720 to your computer and use it in GitHub Desktop.
elsif File.exists?('/etc/slackware-version')
platform "slackware"
platform_family "slackware"
platform_version File.read("/etc/slackware-version").scan(/(\d+|\.+)/).join
elsif File.exists?('/etc/arch-release')
platform "arch"
platform_family "arch"
# no way to determine platform_version in a rolling release distribution
# kernel release will be used - ex. 2.6.32-ARCH
end
# There is some redundancy here, so that we can ensure that even
# if LSB values are used for platform, we will still properly map
# platform_family
case platform
when /debian/, /ubuntu/, /mint/
platform_family "debian"
when /fedora/, /amazon/, /oracle/, /centos/, /redhat/, /scientific/
platform_family "redhat"
when /suse/
platform_family "suse"
when /gentoo/
platform_family "gentoo"
when /slackware/
platform_family "slackware"
when /arch/
platform_family "arch"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment