Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed Debian platform tag for aarch64/arm64 #1775

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/fpm/package/deb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,9 @@ def architecture
when "x86_64"
# Debian calls x86_64 "amd64"
@architecture = "amd64"
when "aarch64"
# Debian calls aarch64 "arm64"
@architecture = "arm64"
when "noarch"
# Debian calls noarch "all"
@architecture = "all"
Expand Down
2 changes: 2 additions & 0 deletions lib/fpm/package/freebsd.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ def architecture
wordsize = case @architecture
when nil, 'native'
%x{getconf LONG_BIT}.chomp # 'native' is current arch
when 'arm64'
'64'
when 'amd64'
'64'
when 'i386'
Expand Down
2 changes: 2 additions & 0 deletions lib/fpm/package/rpm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,8 @@ def architecture
return %x{uname -m}.chomp # default to current arch
when "amd64" # debian and redhat disagree on architecture names
return "x86_64"
when "arm64" # debian and redhat disagree on architecture names
return "aarch64"
when "native"
return %x{uname -m}.chomp # 'native' is current arch
when "all"
Expand Down
5 changes: 5 additions & 0 deletions spec/fpm/package/deb_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@
expect(subject.architecture).to(be == "amd64")
end

it "should convert aarch64 to arm64" do
subject.architecture = "aarch64"
expect(subject.architecture).to(be == "arm64")
end

it "should convert noarch to all" do
subject.architecture = "noarch"
expect(subject.architecture).to(be == "all")
Expand Down
13 changes: 9 additions & 4 deletions spec/fpm/package/rpm_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@
insist { subject.architecture } == "x86_64"
end

it "should convert arm64 to aarch64" do
subject.architecture = "arm64"
expect(subject.architecture).to(be == "aarch64")
end

it "should convert 'all' to 'noarch'" do
subject.architecture = "all"
insist { subject.architecture } == "noarch"
Expand Down Expand Up @@ -596,14 +601,14 @@ def subject.render_template; @rpmspec = template("rpm.erb").result(binding); end
it "should not cause errors when reading basic rpm in input (#802)" do
# Write the rpm out
@generator.output(@target)

# Load generated rpm
subject.input(@target)

# Value sanity check
insist { subject.name } == "name"
insist { subject.version } == "1.23"
end
end

it "should not cause errors when reading more complete rpm in input (#802)" do
@generator.architecture = "all"
Expand Down Expand Up @@ -632,7 +637,7 @@ def subject.render_template; @rpmspec = template("rpm.erb").result(binding); end
insist { subject.conflicts[0] } == "bad < 2"
insist { subject.license } == @generator.license.split("\n").join(" ") # See issue #252
insist { subject.provides[0] } == "bacon = 1.0"

end
it "should not cause errors when reading rpm with script in input (#802)" do
@generator.scripts[:before_install] = "example before_install"
Expand Down