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

Make RPM cope with an input epoch of zero. #343

Merged
merged 2 commits into from Jan 24, 2013

Conversation

Projects
None yet
2 participants
@barn
Contributor

barn commented Jan 17, 2013

Some RPMs from jpackage.org have their epoch set to 0, causing epoch to
raise an exception.

[kali:Downloads]% fpm -s rpm -t rpm --edit ant-1.8.2-5.jpp6.noarch.rpm
/Users/ben/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/fpm-0.4.27/lib/fpm/package/rpm.rb:274:in `epoch': undefined method `empty?' for 0:Fixnum (NoMethodError)
    from /Users/ben/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/fpm-0.4.27/lib/fpm/command.rb:342:in `block in execute'
    from /Users/ben/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/fpm-0.4.27/lib/fpm/command.rb:350:in `call'
    from /Users/ben/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/fpm-0.4.27/lib/fpm/command.rb:350:in `execute'
    from /Users/ben/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/clamp-0.3.1/lib/clamp/command.rb:64:in `run'
    from /Users/ben/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/clamp-0.3.1/lib/clamp/command.rb:126:in `run'
    from /Users/ben/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/fpm-0.4.27/bin/fpm:8:in `<top (required)>'
    from /Users/ben/.rbenv/versions/1.9.3-p327/bin/fpm:23:in `load'
    from /Users/ben/.rbenv/versions/1.9.3-p327/bin/fpm:23:in `<main>'
Make RPM cope with an input epoch of zero.
Some RPMs from jpackage.org have their epoch set to 0, causing epoch to
raise an exception.
@@ -271,6 +271,7 @@ def build_sub_dir
# with fpm 0.4.3 and older)
def epoch
return 1 if @epoch.nil?
return 0 if @epoch == 0

This comment has been minimized.

@jordansissel

jordansissel Jan 18, 2013

Owner

should probably just 'return @epoch if @epoch.is_a?(Numeric)'

I also need to figure out why on some RPM systems, epoch is a string, others it's a number, others it's an array of one number :(

Actually, just cope with epoch being a number in general.
Further to checking if epoch is zero, just allow epoch through if it's a
number, as it should be.

jordansissel added a commit that referenced this pull request Jan 24, 2013

Merge pull request #343 from barn/epoch_of_zero
Make RPM cope with an input epoch of zero.

@jordansissel jordansissel merged commit 66fe665 into jordansissel:master Jan 24, 2013

1 check passed

default The Travis build passed
Details

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

jls
Merge pull request jordansissel#343 from barn/epoch_of_zero
Make RPM cope with an input epoch of zero.

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

Merge pull request jordansissel#343 from barn/epoch_of_zero
Make RPM cope with an input epoch of zero.

jordansissel added a commit that referenced this pull request Apr 24, 2015

Merge pull request #343 from barn/epoch_of_zero
Make RPM cope with an input epoch of zero.

jordansissel added a commit that referenced this pull request Jun 20, 2016

Merge pull request #343 from barn/epoch_of_zero
Make RPM cope with an input epoch of zero.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment