Issue #17745 has been updated by Jeff McCune.

Category set to package
Status changed from Unreviewed to Needs More Information
Assignee set to Pierre Larsson

Pierre,

Are you certain that yum treats `foo-2.2-SNAPSHOT20121119105647` as an 
_earlier_ version compared to `foo-2.2-405.noarch.rpm` ?  The downgrade command 
may simply by taking the specific version you specify and then installs that 
version.

Reading through 
<http://fedoraproject.org/wiki/Packaging:NamingGuidelines#NonNumericRelease>, 
it appears that the release field semantics make SNAPSHOT a later release 
relative to 405.

Could you put both packages in a repository and see which one is the "latest" ? 
 If Puppet does not match the behavior of what yum considers the latest 
package, then that's definitely a bug, but I'm not yet convinced this is 
actually broken after reviewing the Fedora package version guidelines.

-Jeff
----------------------------------------
Bug #17745: Comparing package versions in puppet behaves differently to yum
https://projects.puppetlabs.com/issues/17745#change-77260

Author: Pierre Larsson
Status: Needs More Information
Priority: Normal
Assignee: Pierre Larsson
Category: package
Target version: 
Affected Puppet version: 2.7.19
Keywords: 
Branch: 


I'm trying to make use of the yum downgrade functionality which is described in 
Issue #2866.

Our build process creates packages with a typical rpm version say:

foo-2.2-405.noarch.rpm which compared with package foo-2.2-406.noarch.rpm works 
perfectly fine

But If I build a local version of my package there is no build number and the 
package is named for ex:

foo-2.2-SNAPSHOT20121119105647.noarch.rpm which compared with 
foo-2.2-405.noarch.rpm in puppet returns as a higher version.

With foo-2.2-405.noarch.rpm installed I can do yum downgrade 
foo-2.2-SNAPSHOT20121119105647 but the same thing in a puppet manifest fails at 
this stage in puppet/provider/package/yum.rb:

<pre>if is && Puppet::Util::Package.versioncmp(should, is[:ensure]) < 0</pre>

Which leads me to:
puppet/util/package.rb where the version compare is happening. Can this be 
updated to compare the versions in the same way yum does?

For completeness I want the puppet manifests to be the same in all 
environments, from LOCAL->DEV->QA->PROD and not have to add any extra exec's to 
uninstall packages.

Thanks,
Pierre


-- 
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