Issue #12179 has been updated by Reid Vandewiele.

Pieter van de Bruggen wrote:
> Thanks for continuing to think abou this.  My concern is that this solution 
> depends on many assumptions:
>
>   * Is version disparity across multiple nodes acceptable or desirable?

If disparity across multiple nodes is a concern then ensuring Less Than, 
Greater Than, or anything other than Equal To / Latest (in conjunction with a 
controlled repository) is a mistake. Better to use the existing latest / number.

>   * Are packages guaranteed to remain backwards compatible (or will we need 
> to add further restrictions to the comparison language)?

Creating a comparison language is much more complicated than what a 
`minimum_versionable` type feature could provide. IMHO there's no elegant way 
to make those kinds of sane-default versioning decisions. In that, I agree with 
comments [1](#note-1) and [3](#note-3). 

>   * What does it mean to be "less than" a version?
>     * Is '1.5' less than '1.5-2'?  (The '-2' representing a pre-release 
> build.)
>     * Is '1.5-2' less than '1.5'?  (The '-2' indicating a patch build.)
>     * Do we compare ASCIIbetically?  If so, '10.0' is less than '2.0'.
>     * Do we compare only the numeric parts?  If so, is having more numeric 
> parts "greater"?  What about non-numeric word parts like "alpha"?
>   * Can all packages in a provider be compared the same way?

The [demonstration 
implementation](https://github.com/marut/puppet/compare/puppetlabs:b19931ad8b0dc7f...marut:8975_package_feature_minimum_versionable)
 I posted implements a `minimum_versionable` feature for the apt provider, and 
compares package versions with the 
[versioncmp](https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/package.rb)
 function included in Puppet core. However, that logic can and should be 
defined on a per-provider basis.
 
> I'm not opposed to the idea of a feature like this, I just want to make sure 
> we can do so without it coming back to bite people later.

The `minimum_versionable` suggestion is more in line with comments 
[4](#note-4), [5](#note-5), and [6](#note-6) than with the original feature 
description. It aims to be a solution significantly reduced in scope which 
addresses a useful version of the problem people are trying to solve in a sane 
and predictable way.
----------------------------------------
Feature #12179: Package resource should allow ensure=>">1.0" or ensure=>"<0.10" 
as well as 'latest', 'installed' and specific version number
https://projects.puppetlabs.com/issues/12179#change-63655

Author: Steve Shipway
Status: Needs Decision
Priority: Normal
Assignee: Randall Hansen
Category: language
Target version: 
Affected Puppet version: 2.7.9
Keywords: 
Branch: 


It would be helpful if the 'ensure' parameter to the Package resrouce could 
also specify 'at least version **x**' and 'no later than version **y**' as well 
as 'latest version', 'installed' (IE, any version) or a specific version number.

EG:

    package { 'foo': ensure=>'>1.0' }

would act as 'latest' if the current package was uninstalled or version before 
1.0, but would act as 'installed' otherwise. Similarly, 

    package { 'foo': ensure=>'<4.0' }

would act as 'installed' if version is <4.0 but would produce an error 
otherwise.

This would allow us to set a manifest to avoid packages with known problems in 
a certain version, but not upgrade unless necessary. 


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to