Skip to content

Commit

Permalink
Fixes #707
Browse files Browse the repository at this point in the history
With rpms, if `--architecture` and `--rpm-os` are specified and
different than the host, `--target` would be passed to `rpmbuild` twice,
causing an error.

Example: an OS X host (`uname -s` = "Darwin") with x86_64 architecture
building for `--rpm-os linux` and `--architecture noarch`.

This change only adds `--target` to the `rpmbuild` args once, fixing
this specific error.
  • Loading branch information
alanivey committed Jun 9, 2014
1 parent 22e3a39 commit 915fafc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/fpm/package/rpm.rb
Expand Up @@ -309,12 +309,16 @@ def output(output_path)
args = ["rpmbuild", "-bb"]

if %x{uname -m}.chomp != self.architecture
args += [ '--target', self.architecture ]
rpm_target = self.architecture
end

# issue #309
if !attributes[:rpm_os].nil?
rpm_target = "#{architecture}-unknown-#{attributes[:rpm_os]}"
end

# issue #707
if !rpm_target.nil?
args += ["--target", rpm_target]
end

Expand Down

0 comments on commit 915fafc

Please sign in to comment.