Package list ohcount / lintian-fixes/main ruby / print_arch
lintian-fixes/main

Tree @lintian-fixes/main (Download .tar.gz)

print_arch @lintian-fixes/mainraw · history · blame

#!/usr/bin/env ruby
require 'mkmf'

arch = RbConfig::expand(CONFIG["arch"])

distro = if File.exist?("/etc/os-release")
  # this is "", "CentOS" or "Ubuntu"
  `egrep "^ID=.*" /etc/os-release`.split("=")[1].downcase
end

unless %w[centos ubuntu fedora].include?(distro.to_s.chomp)
	STDERR.puts "unhandled /etc/os-release result: #{distro}"
end

# either <arch> or <arch>_<distro> if distro is non-null
puts [arch, distro].compact.join("_")