Skip to content

Use package_ensure if it specifies a version instead of the minimum_version #215

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

Merged
merged 1 commit into from
Jul 12, 2017

Conversation

sp-joseluis-ledesma
Copy link
Contributor

When using package_ensure => some_version, it will initially configure the the redis using the minimum_version variable anyway instead of taking in account the package_ensure variable. This PR fixes that.

@petems
Copy link
Member

petems commented Jul 11, 2017

Ah, good point, didn't think of that usecase! Let me review this 😄

@@ -276,7 +277,11 @@
refreshonly => true,
}

$redis_version_real = pick(getvar_emptystring('redis_server_version'), $minimum_version)
if $package_ensure =~ /^[0-9]\.[0-9]/ {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, we might want to extend this regex. If someone's using an rc/alpha candidate this regex won't match (eg. https://github.com/antirez/redis/archive/4.0-rc3.tar.gz)

Can we extend the regex and add some extra usecases to the specs? eg. 3 digits (3.2.1), non-numeric characters (4.0.0-rc)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The regex matches (I did not look for the end of the regex, only start with [0-9].[0-9]). Anyway I've improved it a bit (/^[0-9]+.[0-9]/) so it will work when redis get to version 10 :).

I've added a couple more of specs usecases.

@petems
Copy link
Member

petems commented Jul 12, 2017

Awesome, LGTM! 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants