Commit 798a0074 authored by Seth Chisamore's avatar Seth Chisamore

Use the proper architecture value in Solaris packages

We should be using the more general instruction set architecture (e.g.
`sparc` vs `sun4v`/`sun4u`)

Fixes chef/chef#4018
parent f549df66
......@@ -22,6 +22,7 @@ module Omnibus
include Digestable
include Logging
include NullArgumentable
include Sugarable
include Templating
include Util
......
......@@ -36,7 +36,7 @@ module Omnibus
# @see Base#package_name
def package_name
"#{project.package_name}-#{pkgmk_version}.#{Ohai['kernel']['machine']}.solaris"
"#{project.package_name}-#{pkgmk_version}.#{safe_architecture}.solaris"
end
def pkgmk_version
......@@ -88,7 +88,7 @@ module Omnibus
BASEDIR=#{install_dirname}
PKG=#{project.package_name}
NAME=#{project.package_name}
ARCH=#{`uname -p`.chomp}
ARCH=#{safe_architecture}
VERSION=#{pkgmk_version}
CATEGORY=application
DESC=#{project.description}
......@@ -100,5 +100,21 @@ module Omnibus
f.write pkginfo_content
end
end
#
# The architecture for this Solaris package.
#
# @return [String]
#
def safe_architecture
# The #i386? and #intel? helpers come from chef-sugar
if intel?
'i386'
elsif sparc?
'sparc'
else
Ohai['kernel']['machine']
end
end
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment