On 21/03/11 11:50, Dominic Cleal wrote: > On 21/03/11 09:08, Dominic Cleal wrote: >> On 21/03/11 03:54, Juerg Walz wrote: >>> diff --git a/lib/puppet/provider/package/pkgutil.rb >>> b/lib/puppet/provider/package/pkgutil.rb >>> index 350cacc..97625f2 100755 >>> --- a/lib/puppet/provider/package/pkgutil.rb >>> +++ b/lib/puppet/provider/package/pkgutil.rb >>> @@ -38,7 +38,7 @@ Puppet::Type.type(:package).provide :pkgutil, :parent => >>> :sun, :source => :sun d >>> # Create a second instance with the alias if it's different >>> pkgalias = aliases[pkg[:name]] >>> if pkgalias and pkg[:name] != pkgalias >>> - apkg = Hash.new(pkg) >>> + apkg = pkg >>> apkg[:name] = pkgalias >>> pkginsts << new(apkg) >>> end >> >> Thanks for the testing - what issue did you run into with this? > > Sorry, just saw the "cover note" on the patch set that explained it. > Perhaps we should be doing pkg.dup here - not sure where I got the > Hash.new bit from, I'd intended to duplicate it.
Yep, fixed with pkg.dup. > As below though, I'll do a bit more testing later to see exactly what > the issue was and try and capture it in a test before changing it again. It was causing the main package names to be queried each time, perhaps as a reference to the hash is kept internally to the provider instance, so we were modifying the same one. I couldn't see an obvious way to test for this. -- Dominic Cleal Red Hat Consulting m: +44 (0)7818 512168 -- You received this message because you are subscribed to the Google Groups "Puppet Developers" group. To post to this group, send email to puppet-dev@googlegroups.com. To unsubscribe from this group, send email to puppet-dev+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.