Skip to content

Commit

Permalink
Always treat perl dependency version as a string. (#1515)
Browse files Browse the repository at this point in the history
Perl modules have both META.json and META.yml. In the JSON, the perl
dependency appears as a string `"5.004"`, but in YAML it appears as a
number `5.004`! This may cause fpm to fail when trying to convert the
perl version into a dependency, so we now always treat the perl version
as a string.

Fixes #1514
  • Loading branch information
jordansissel committed Jul 4, 2018
1 parent 3ab03e4 commit 20e89a6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/fpm/package/cpan.rb
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def input(package)
found_dependencies.each do |dep_name, version|
# Special case for representing perl core as a version.
if dep_name == "perl"
m = version.match(/^(\d)\.(\d{3})(\d{3})$/)
m = version.to_s.match(/^(\d)\.(\d{3})(\d{3})$/)
if m
version = m[1] + '.' + m[2].sub(/^0*/, '') + '.' + m[3].sub(/^0*/, '')
end
Expand Down

0 comments on commit 20e89a6

Please sign in to comment.