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

FPM always builds latest gem, irrespectful of -v option #204

Closed
ghost opened this Issue Apr 12, 2012 · 12 comments

Comments

Projects
None yet
3 participants
@ghost

ghost commented Apr 12, 2012

I'm using fpm 0.4.6.

I'm trying to build backports version 2.3.0, but it builds 2.5.1 (latest):

fpm -s gem -t rpm -v 2.3.0 backports
Successfully installed backports-2.5.1
1 gem installed
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.3Tpnlj
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.DKip1r
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.0NuFHA
Processing files: rubygem-backports-2.3.0-1.noarch
Wrote: /tmp/package-rpm-build20120412-8468-mcgli6/RPMS/noarch/rubygem-backports-2.3.0-1.noarch.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.QuSdaT
Created rpm {"path":"rubygem-backports-2.3.0-1.noarch.rpm"}

Inside the rpm there's 2.5.1

rpm -qlp rubygem-backports-2.3.0-1.noarch.rpm
/usr/bin
/usr/lib/ruby/gems/1.8/cache/backports-2.5.1.gem
/usr/lib/ruby/gems/1.8/doc
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/.document
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/.gitignore
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/.irbrc
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/CHANGELOG.rdoc
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/LICENSE
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/README.rdoc
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/Rakefile
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/VERSION.yml
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/backports.gemspec
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.8.7.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.8.7/argf.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.8.7/array.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.8.7/binding.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.8.7/dir.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.8.7/enumerable.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.8.7/enumerator.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.8.7/env.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.8.7/fixnum.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.8.7/float.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.8.7/gc.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.8.7/hash.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.8.7/integer.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.8.7/io.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.8.7/kernel.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.8.7/method.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.8.7/module.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.8.7/numeric.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.8.7/object_space.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.8.7/proc.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.8.7/process.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.8.7/range.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.8.7/regexp.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.8.7/string.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.8.7/struct.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.8.7/symbol.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.8.8.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.8.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.9.1.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.9.1/array.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.9.1/dir.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.9.1/enumerable.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.9.1/enumerator.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.9.1/env.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.9.1/file.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.9.1/float.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.9.1/hash.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.9.1/integer.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.9.1/io.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.9.1/kernel.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.9.1/math.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.9.1/numeric.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.9.1/proc.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.9.1/range.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.9.1/regexp.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.9.1/stdlib.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.9.1/stdlib/prime.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.9.1/string.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.9.1/symbol.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.9.2.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.9.2/array.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.9.2/complex.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.9.2/dir.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.9.2/enumerable.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.9.2/float.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.9.2/hash.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.9.2/kernel.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.9.2/match_data.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.9.2/random.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.9.2/random/MT19937.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.9.2/random/bits_and_bytes.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.9.2/random/implementation.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.9.2/random/load.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.9.2/stdlib.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.9.2/stdlib/matrix.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.9.2/stdlib/matrix/eigenvalue_decomposition.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.9.2/stdlib/matrix/lup_decomposition.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.9.2/stdlib/set.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.9.3.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.9.3/file.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.9.3/io.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.9.3/string.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/1.9.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/basic_object.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/force/array_map.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/force/enumerable_map.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/force/hash_select.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/force/string_length.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/force/string_size.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/rails.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/rails/array.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/rails/enumerable.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/rails/hash.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/rails/kernel.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/rails/module.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/rails/string.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/lib/backports/tools.rb
/usr/lib/ruby/gems/1.8/gems/backports-2.5.1/test/README
/usr/lib/ruby/gems/1.8/specifications/backports-2.5.1.gemspec

Debug version:

fpm --debug -s gem -t rpm -v 2.3.0 backports
/usr/lib/ruby/gems/1.8/gems/fpm-0.4.6/lib/fpm/package/rpm.rb:23: warning: already initialized constant DIGEST_ALGORITHM_MAP
/usr/lib/ruby/gems/1.8/gems/fpm-0.4.6/lib/fpm/package/rpm.rb:29: warning: already initialized constant COMPRESSION_MAP
/usr/lib/ruby/gems/1.8/gems/fpm-0.4.6/lib/fpm/package/deb.rb:19: warning: already initialized constant SCRIPT_MAP
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","output_type":"rpm","level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","input_type":"gem","level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","chdir":null,"level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","prefix":null,"level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","package":null,"level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","name":null,"level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","verbose?":null,"level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","debug?":true,"level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","version":"2.3.0","level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","iteration":null,"level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","epoch":null,"level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","license":null,"level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","vendor":null,"level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","category":"none","level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","dependencies":[],"level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","provides":[],"level":"debug"}
Setting attribute {"file":"fpm/command.rb","conflicts":[],"method":"execute","line":"234","level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","replaces":[],"level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","config_files":[],"level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","architecture":null,"level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","maintainer":"root@sl62test00","level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","package_name_suffix":null,"level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","edit?":false,"level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","excludes":[],"level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","description":"no description","level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","url":"http://example.com/no-uri-given","level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","inputs":null,"level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","post_install":null,"level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","pre_install":null,"level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","post_uninstall":null,"level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","pre_uninstall":null,"level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","after_install":null,"level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","before_install":null,"level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","after_remove":null,"level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","before_remove":null,"level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","deb_ignore_iteration_in_dependencies?":null,"level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","deb_pre_depends":null,"level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","deb_custom_control":null,"level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","deb_config":null,"level":"debug"}
Setting attribute {"file":"fpm/command.rb","deb_templates":null,"method":"execute","line":"234","level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","deb_installed_size":null,"level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","deb_ignore_iteration_in_dependencies?":null,"level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","deb_pre_depends":null,"level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","deb_custom_control":null,"level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","deb_config":null,"level":"debug"}
Setting attribute {"file":"fpm/command.rb","deb_templates":null,"method":"execute","line":"234","level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","deb_installed_size":null,"level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","rpm_rpmbuild_define":null,"level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","rpm_digest":"md5","level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","rpm_compression":"gzip","level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","rpm_rpmbuild_define":null,"level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","rpm_digest":"md5","level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","rpm_compression":"gzip","level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","gem_bin_path":"/usr/bin","level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","gem_package_prefix":null,"level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","gem_package_name_prefix":"rubygem","level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","gem_gem":"gem","level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","gem_fix_name?":true,"level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","gem_fix_dependencies?":true,"level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","gem_bin_path":"/usr/bin","level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","gem_package_prefix":null,"level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","gem_package_name_prefix":"rubygem","level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","gem_gem":"gem","level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","gem_fix_name?":true,"level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","gem_fix_dependencies?":true,"level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","python_bin":"python","level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","python_easyinstall":"easy_install","level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","python_pypi":"http://pypi.python.org/simple","level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","python_package_prefix":null,"level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","python_package_name_prefix":"python","level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","python_fix_name?":true,"level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","python_fix_dependencies?":true,"level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","python_install_bin":"/usr/bin","level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","python_install_lib":null,"level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","python_bin":"python","level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","python_easyinstall":"easy_install","level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","python_pypi":"http://pypi.python.org/simple","level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","python_package_prefix":null,"level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","python_package_name_prefix":"python","level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","python_fix_name?":true,"level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","python_fix_dependencies?":true,"level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","python_install_bin":"/usr/bin","level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","python_install_lib":null,"level":"debug"}
Setting attribute {"file":"fpm/command.rb","method":"execute","line":"234","pear_package_name_prefix":"php-pear","level":"debug"}
Trying to download {"file":"fpm/package/gem.rb","method":"download","line":"70","version":null,"gem":"backports","level":"info"}
Using gem file {"file":"fpm/package/gem.rb","method":"download_if_necessary","line":"61","path":"/usr/lib/ruby/gems/1.8/cache/backports-2.5.1.gem","level":"info"}
Running command {"file":"fpm/util.rb","method":"safesystem","line":"29","args":["gem","install","--quiet","--no-ri","--no-rdoc","--install-dir","/tmp/package-gem-staging20120412-8696-zp8f0g/usr/lib/ruby/gems/1.8","--ignore-dependencies","-E","--bindir","/tmp/package-gem-staging20120412-8696-zp8f0g/usr/bin","/usr/lib/ruby/gems/1.8/cache/backports-2.5.1.gem"],"level":"debug"}
Successfully installed backports-2.5.1
1 gem installed
Setting from flags: epoch= {"file":"fpm/command.rb","method":"execute","line":"270","level":"info"}
Setting from flags: iteration= {"file":"fpm/command.rb","method":"execute","line":"270","level":"info"}
Setting from flags: version=2.3.0 {"file":"fpm/command.rb","method":"execute","line":"270","level":"info"}
Converting gem to rpm {"file":"fpm/package.rb","method":"convert","line":"175","level":"info"}
Cleaning up staging path {"file":"fpm/package.rb","method":"cleanup_staging","line":"259","path":"/tmp/package-rpm-staging20120412-8696-ierv6k","level":"debug"}
Reading template {"file":"fpm/package.rb","method":"template","line":"306","path":"/usr/lib/ruby/gems/1.8/gems/fpm-0.4.6/lib/fpm/../../templates/rpm.erb","level":"info"}
Running rpmbuild {"file":"fpm/package/rpm.rb","method":"output","line":"171","args":["rpmbuild","-bb","--define","buildroot /tmp/package-rpm-build20120412-8696-1utfr88/BUILD","--define","_topdir /tmp/package-rpm-build20120412-8696-1utfr88","--define","_sourcedir /tmp/package-rpm-build20120412-8696-1utfr88","--define","_rpmdir /tmp/package-rpm-build20120412-8696-1utfr88/RPMS","/tmp/package-rpm-build20120412-8696-1utfr88/SPECS/rubygem-backports.spec"],"level":"info"}
Running command {"file":"fpm/util.rb","method":"safesystem","line":"29","args":["rpmbuild","-bb","--define","buildroot /tmp/package-rpm-build20120412-8696-1utfr88/BUILD","--define","_topdir /tmp/package-rpm-build20120412-8696-1utfr88","--define","_sourcedir /tmp/package-rpm-build20120412-8696-1utfr88","--define","_rpmdir /tmp/package-rpm-build20120412-8696-1utfr88/RPMS","/tmp/package-rpm-build20120412-8696-1utfr88/SPECS/rubygem-backports.spec"],"level":"debug"}
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.AjKlC0
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.nlIRJ3
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.A35CR6
Processing files: rubygem-backports-2.3.0-1.noarch
Wrote: /tmp/package-rpm-build20120412-8696-1utfr88/RPMS/noarch/rubygem-backports-2.3.0-1.noarch.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.cJFbee
Created rpm {"file":"fpm/command.rb","method":"execute","line":"324","path":"rubygem-backports-2.3.0-1.noarch.rpm"}
Cleaning up staging path {"file":"fpm/package.rb","method":"cleanup_staging","line":"259","path":"/tmp/package-gem-staging20120412-8696-zp8f0g","level":"debug"}
Cleaning up build path {"file":"fpm/package.rb","method":"cleanup_build","line":"266","path":"/tmp/package-gem-build20120412-8696-egjbax","level":"debug"}
Cleaning up build path {"file":"fpm/package.rb","method":"cleanup_build","line":"266","path":"/tmp/package-rpm-build20120412-8696-1utfr88","level":"debug"}

@ghost

This comment has been minimized.

ghost commented Apr 12, 2012

I reverted to using 0.3.11 and it's building correct package versions.

@jordansissel

This comment has been minimized.

Owner

jordansissel commented Apr 12, 2012

Oof, bad bug! Thanks for reporting :)

@vStone

This comment has been minimized.

Contributor

vStone commented May 15, 2012

The danger here is that he does give the output package the correct version, confuuuusingggg :)

@vStone

This comment has been minimized.

Contributor

vStone commented May 15, 2012

Could it be this easy?

diff --git a/lib/fpm/package/gem.rb b/lib/fpm/package/gem.rb
index f4034dd..446a326 100644
--- a/lib/fpm/package/gem.rb
+++ b/lib/fpm/package/gem.rb
@@ -37,7 +37,7 @@ class FPM::Package::Gem < FPM::Package

   def input(gem)
     # 'arg'  is the name of the rubygem we should unpack.
-    path_to_gem = download_if_necessary(gem, version)
+    path_to_gem = download_if_necessary(gem, attributes[:version])

     # Got a good gem now (downloaded or otherwise)
     #
@jordansissel

This comment has been minimized.

Owner

jordansissel commented May 15, 2012

Almost, that defaults to 1.0, which probably isn't what we want ;)

@jordansissel

This comment has been minimized.

Owner

jordansissel commented May 15, 2012

Working on this now

@jordansissel

This comment has been minimized.

Owner

jordansissel commented May 15, 2012

Fixing this properly would requires some better tracking of whether or not a flag was specified.

jordansissel added a commit that referenced this issue May 15, 2012

- Fix versioned downloading for gem and python packages.
  Tested: fpm -s gem -t deb -v 1.7.1 json
    Successfully installed json-1.7.1
  Tested: fpm -s python -t deb -v 2.1.6 simplejson
  Relevant output:
    Searching for simplejson==2.1.6
    Reading http://pypi.python.org/simple/simplejson/
    Reading http://github.com/simplejson/simplejson
    Reading http://undefined.org/python/#simplejson
    Best match: simplejson 2.1.6
    Downloading
    http://pypi.python.org/packages/source/s/simplejson/simplejson-2.1.6
    .tar.gz#md5=2f8351f6e6fe7ef25744805dfa56c0d5
    Processing simplejson-2.1.6.tar.gz

  Related tickets: #215, #204
@jordansissel

This comment has been minimized.

Owner

jordansissel commented May 15, 2012

Fixed in master, will show up in the next fpm release.

@sawtelle

This comment has been minimized.

sawtelle commented Jun 14, 2012

I tried master with "fpm -s gem -t rpm typhoeus --version 0.3.3" but got the result below. Caveat: I'm new to fpm.

I did find the workaround of "gem fetch typhoeus --version 0.3.3" then "fpm -s gem -t rpm typhoeus-0.3.3.gem" to be successful.

$ fpm -s gem -t rpm typhoeus --version 0.3.3
Successfully installed typhoeus-0.4.2
1 gem installed
Invalid gem? {"version":"0.4.2","level":"error","errors":[],"name":"--version"}
/usr/lib/ruby/gems/1.8/gems/fpm-0.4.10/lib/fpm/package/gem.rb:88:in `download': Invalid gem: --version (FPM::Package::InvalidArgument)
    from /usr/lib/ruby/gems/1.8/gems/fpm-0.4.10/lib/fpm/package/gem.rb:55:in `download_if_necessary'
    from /usr/lib/ruby/gems/1.8/gems/fpm-0.4.10/lib/fpm/package/gem.rb:40:in `input'
    from /usr/lib/ruby/gems/1.8/gems/fpm-0.4.10/lib/fpm/command.rb:248:in `execute'
    from /usr/lib/ruby/gems/1.8/gems/fpm-0.4.10/lib/fpm/command.rb:247:in `each'
    from /usr/lib/ruby/gems/1.8/gems/fpm-0.4.10/lib/fpm/command.rb:247:in `execute'
    from /usr/lib/ruby/gems/1.8/gems/clamp-0.3.1/lib/clamp/command.rb:64:in `run'
    from /usr/lib/ruby/gems/1.8/gems/clamp-0.3.1/lib/clamp/command.rb:126:in `run'
    from /usr/lib/ruby/gems/1.8/gems/fpm-0.4.10/bin/fpm:8
    from /usr/bin/fpm:19:in `load'
    from /usr/bin/fpm:19
@jordansissel

This comment has been minimized.

Owner

jordansissel commented Jun 14, 2012

The problem here is that you can't put flags after positional arguments in fpm.

You want:

fpm -s gem -t rpm  --version 0.3.3 typhoeus
@sawtelle

This comment has been minimized.

sawtelle commented Jun 15, 2012

Thanks!

Could be good to have the flag handling more permissive or somehow check for this error so that newbies aren't confused but I understand if that's not a high priority.

Would you be interested in considering a pull request that improves this a little? If so do you have suggestions as to what you would or wouldn't want to see?

@jordansissel

This comment has been minimized.

Owner

jordansissel commented Jun 15, 2012

Agreed! A simple check would be to alert you if your parameters looks like flags. I'll see what I can come up with :)

(Also, avoiding newbie confusion is a high priority!)

prof-milki pushed a commit to prof-milki/xpm that referenced this issue Dec 18, 2014

jls
- Fix versioned downloading for gem and python packages.
  Tested: fpm -s gem -t deb -v 1.7.1 json
    Successfully installed json-1.7.1
  Tested: fpm -s python -t deb -v 2.1.6 simplejson
  Relevant output:
    Searching for simplejson==2.1.6
    Reading http://pypi.python.org/simple/simplejson/
    Reading http://github.com/simplejson/simplejson
    Reading http://undefined.org/python/#simplejson
    Best match: simplejson 2.1.6
    Downloading
    http://pypi.python.org/packages/source/s/simplejson/simplejson-2.1.6
    .tar.gz#md5=2f8351f6e6fe7ef25744805dfa56c0d5
    Processing simplejson-2.1.6.tar.gz

  Related tickets: jordansissel#215, jordansissel#204

prof-milki pushed a commit to prof-milki/xpm that referenced this issue Dec 27, 2014

- Fix versioned downloading for gem and python packages.
  Tested: fpm -s gem -t deb -v 1.7.1 json
    Successfully installed json-1.7.1
  Tested: fpm -s python -t deb -v 2.1.6 simplejson
  Relevant output:
    Searching for simplejson==2.1.6
    Reading http://pypi.python.org/simple/simplejson/
    Reading http://github.com/simplejson/simplejson
    Reading http://undefined.org/python/#simplejson
    Best match: simplejson 2.1.6
    Downloading
    http://pypi.python.org/packages/source/s/simplejson/simplejson-2.1.6
    .tar.gz#md5=2f8351f6e6fe7ef25744805dfa56c0d5
    Processing simplejson-2.1.6.tar.gz

  Related tickets: jordansissel#215, jordansissel#204

jordansissel added a commit that referenced this issue Apr 24, 2015

- Fix versioned downloading for gem and python packages.
  Tested: fpm -s gem -t deb -v 1.7.1 json
    Successfully installed json-1.7.1
  Tested: fpm -s python -t deb -v 2.1.6 simplejson
  Relevant output:
    Searching for simplejson==2.1.6
    Reading http://pypi.python.org/simple/simplejson/
    Reading http://github.com/simplejson/simplejson
    Reading http://undefined.org/python/#simplejson
    Best match: simplejson 2.1.6
    Downloading
    http://pypi.python.org/packages/source/s/simplejson/simplejson-2.1.6
    .tar.gz#md5=2f8351f6e6fe7ef25744805dfa56c0d5
    Processing simplejson-2.1.6.tar.gz

  Related tickets: #215, #204

jordansissel added a commit that referenced this issue Jun 20, 2016

- Fix versioned downloading for gem and python packages.
  Tested: fpm -s gem -t deb -v 1.7.1 json
    Successfully installed json-1.7.1
  Tested: fpm -s python -t deb -v 2.1.6 simplejson
  Relevant output:
    Searching for simplejson==2.1.6
    Reading http://pypi.python.org/simple/simplejson/
    Reading http://github.com/simplejson/simplejson
    Reading http://undefined.org/python/#simplejson
    Best match: simplejson 2.1.6
    Downloading
    http://pypi.python.org/packages/source/s/simplejson/simplejson-2.1.6
    .tar.gz#md5=2f8351f6e6fe7ef25744805dfa56c0d5
    Processing simplejson-2.1.6.tar.gz

  Related tickets: #215, #204
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment