Issue #8312 has been updated by Moses Mendoza. Status changed from Merged - Pending Release to Closed
released in 2.7.12 ---------------------------------------- Bug #8312: zypper ensure latest doesn't work on SLES11 SP1, OpenSUSE 11.4 https://projects.puppetlabs.com/issues/8312#change-56571 Author: Felix Frank Status: Closed Priority: Normal Assignee: Ken Barber Category: package Target version: 2.7.12 Affected Puppet version: 2.6.8 Keywords: zypper, update, latest Branch: https://github.com/kbarber/puppet/tree/ticket/2.7.x/8312-zypper_latest In the zypper provider, the output of `zypper list-updates` is parsed incorrectly. The order of output fields is indeed not "name" | "new version" but "name" | "old version" | "new version" instead. The regexp in the provider therefore returns the old version instead of the new one. I suggest the following patch: <pre> --- puppet-2.6.8.orig/lib/puppet/provider/package/zypper.rb 2011-07-07 18:44:15.000000000 +0200 +++ puppet-2.6.8/lib/puppet/provider/package/zypper.rb 2011-07-08 13:10:24.000000000 +0200 @@ -36,7 +36,7 @@ #zypper can only get a list of *all* available packages? output = zypper "list-updates" - if output =~ /#{Regexp.escape @resource[:name]}\s*\|\s*([^\s\|]+)/ + if output =~ /#{Regexp.escape @resource[:name]}\s*\|.*?\|\s*([^\s\|]+)/ return $1 else # zypper didn't find updates, pretend the current </pre> How to reproduce: With an outdated package installed, run <pre> puppet --noop -e 'package { "<name>": ensure => latest, provider => zypper }' </pre> This will not generate a message about a pending update. -- 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.
