diff options
author | Luke Kanies <luke@madstop.com> | 2007-12-18 16:47:56 -0600 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2007-12-18 16:47:56 -0600 |
commit | 5252f02dba8ef35db77ecb2d9bf711c1fd0b0bb2 (patch) | |
tree | 49e1d8f62fb0d3e954ba2552b050ba9ae6fc5dfb /lib | |
parent | 92b0ebc7b74a29b5b875fc104a3681a264d49f03 (diff) | |
parent | c22a584cbc80f502af7ddcd493114cb9c01f9cb8 (diff) | |
download | puppet-5252f02dba8ef35db77ecb2d9bf711c1fd0b0bb2.tar.gz puppet-5252f02dba8ef35db77ecb2d9bf711c1fd0b0bb2.tar.xz puppet-5252f02dba8ef35db77ecb2d9bf711c1fd0b0bb2.zip |
Merge branch '0.24.x' of ssh://reductivelabs.com/opt/rl/git/puppet into 0.24.x
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/puppet/provider/package/rpm.rb | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/lib/puppet/provider/package/rpm.rb b/lib/puppet/provider/package/rpm.rb index 4af299283..98ca1efa6 100755 --- a/lib/puppet/provider/package/rpm.rb +++ b/lib/puppet/provider/package/rpm.rb @@ -92,6 +92,19 @@ Puppet::Type.type(:package).provide :rpm, :source => :rpm, :parent => Puppet::Pr end def uninstall + query unless get(:arch) + nvr = "#{get(:name)}-#{get(:version)}-#{get(:release)}" + arch = ".#{get(:arch)}" + # If they specified an arch in the manifest, erase that Otherwise, + # erase the arch we got back from the query. If multiple arches are + # installed and only the package name is specified (without the + # arch), this will uninstall all of them on successive runs of the + # client, one after the other + if @resource[:name][-arch.size, arch.size] == arch + nvr += arch + else + nvr += ".#{get(:arch)}" + end rpm "-e", nvr end @@ -99,11 +112,6 @@ Puppet::Type.type(:package).provide :rpm, :source => :rpm, :parent => Puppet::Pr self.install end - def nvr - query unless @nvr - @nvr - end - def self.nevra_to_hash(line) line.chomp! hash = {} |