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

Allow unsetting epoch and iteration by passing empty strings #190

Closed
wants to merge 1 commit into from

Conversation

@torarnv
Copy link
Contributor

torarnv commented Mar 27, 2012

package.rb initializes epoch and iteration to nil, but the default
arguments for both are '1', which means the package version always
ends up with an epoch and an iteration. By changing the template
to take empty strings into account you can customize the version
string by passing --epoch '' and --iteration ''.

package.rb initializes epoch and iteration to nil, but the default
arguments for both are '1', which means the package version always
ends up with an epoch and an iteration. By changing the template
to take empty strings into account you can customize the version
string by passing --epoch '' and --iteration ''.
@@ -1,5 +1,5 @@
Package: <%= name %>
Version: <%= "#{epoch}:" if epoch %><%= version %><%= "-" + iteration.to_s if iteration %>
Version: <%= "#{epoch}" if epoch and not epoch.empty? %><%= version %><%= "-" + iteration.to_s if iteration and not iteration.empty? %>

This comment has been minimized.

Copy link
@jordansissel

jordansissel Mar 30, 2012

Owner

I think the default value of epoch should be package dependent, maybe? Seems like I'm doing something wrong higher up in fpm. I'll take a gander and merge this if I can't fix anything outside the template.

@smith3v

This comment has been minimized.

Copy link

smith3v commented Mar 30, 2012

Look forward for support to remove epoch without patching. Meanwhile I applied the patch manually.

Thanks.

@jordansissel

This comment has been minimized.

Copy link
Owner

jordansissel commented Mar 30, 2012

Fiddling around with things:

% EDITOR="egrep '(Version)'" ruby bin/fpm -e -s dir -t deb -n hello /etc/motd
Version: 1.0
Created deb package {"path":"hello_1.0_amd64.deb"}

After some patching, this seems correct based on the feature requested here (default epoch and iteration should be nil)

@jordansissel

This comment has been minimized.

Copy link
Owner

jordansissel commented Mar 30, 2012

Righto, I think I've fixed this internal to fpm (improves both rpm and deb defaults for iteration and epoch).

@jordansissel

This comment has been minimized.

Copy link
Owner

jordansissel commented Mar 30, 2012

Thanks for the patch, by the way (even if it wasn't merged!) :) :)

@torarnv

This comment has been minimized.

Copy link
Contributor Author

torarnv commented Apr 12, 2012

Thanks for fixing it the proper way :)

prof-milki pushed a commit to prof-milki/xpm that referenced this pull request Dec 18, 2014
prof-milki pushed a commit to prof-milki/xpm that referenced this pull request Dec 27, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.