Skip to content

Loading…

Remove dashes from the version in rpm targets #97

Merged
merged 1 commit into from

2 participants

@tabletcorry

RPMs do not allow dashes in the main part of the version string.

I ripped this code right out of the Deb target file, and it seems to work.

This has been tested with -t rpm (of course) in conjunction with -s gem and -s python.

@tabletcorry

Whoops, this is broken. Don't take it yet.

@tabletcorry tabletcorry Remove dashes from the version in rpm targets
RPMs do not allow dashes in the main part of the version string.

We need to test @version because some sources (I am looking at you gem)
set version to a Fixnum, and others to a String.
dccf79e
@tabletcorry

Ok, works better now. I broke gem sources since it was not testing @version for its type.

Perhaps @version should be a consistent type?

@jordansissel

Yeah @version should be better. fpm needs some refactoring to pull out some of the badness some day ;)

@jordansissel
Owner

will merge now, testing this weekend.

@jordansissel jordansissel merged commit 16734da into jordansissel:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 23, 2011
  1. @tabletcorry

    Remove dashes from the version in rpm targets

    tabletcorry committed
    RPMs do not allow dashes in the main part of the version string.
    
    We need to test @version because some sources (I am looking at you gem)
    set version to a Fixnum, and others to a String.
This page is out of date. Refresh to see the latest.
Showing with 10 additions and 0 deletions.
  1. +10 −0 lib/fpm/target/rpm.rb
View
10 lib/fpm/target/rpm.rb
@@ -28,6 +28,16 @@ def url
end
end
+ def version
+ if @version.kind_of?(String) and @version.include?("-")
+ @logger.info("Package version '#{@version}' includes dashes, converting" \
+ " to underscores")
+ @version = @version.gsub(/-/, "_")
+ end
+
+ return @version
+ end
+
def build!(params)
raise "No package name given. Can't assemble package" if !@name
# TODO(sissel): Abort if 'rpmbuild' tool not found.
Something went wrong with that request. Please try again.