summaryrefslogtreecommitdiffstats
path: root/lib/puppet
diff options
context:
space:
mode:
authormpalmer <mpalmer@980ebf18-57e1-0310-9a29-db15c13687c0>2007-02-26 01:17:48 +0000
committermpalmer <mpalmer@980ebf18-57e1-0310-9a29-db15c13687c0>2007-02-26 01:17:48 +0000
commit3e13e360aa66d7eb521a0cc041c0dca049774efc (patch)
tree76eca94af2557c9c4fd9f234db3679983b33c5b8 /lib/puppet
parent1d711dcfd902035b9be81debcfb5c271f78ae154 (diff)
downloadpuppet-3e13e360aa66d7eb521a0cc041c0dca049774efc.tar.gz
puppet-3e13e360aa66d7eb521a0cc041c0dca049774efc.tar.xz
puppet-3e13e360aa66d7eb521a0cc041c0dca049774efc.zip
Actually commit the changes to lib/puppet that were supposed to be part of [2223] (Fuck svn and it's partial-repository-by-default behaviour)
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2224 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet')
-rwxr-xr-xlib/puppet/provider/package/apt.rb14
-rwxr-xr-xlib/puppet/provider/package/aptitude.rb6
-rwxr-xr-xlib/puppet/provider/package/dpkg.rb4
-rw-r--r--lib/puppet/type/package.rb10
4 files changed, 25 insertions, 9 deletions
diff --git a/lib/puppet/provider/package/apt.rb b/lib/puppet/provider/package/apt.rb
index 6fa70e56a..79a9e5f8e 100755
--- a/lib/puppet/provider/package/apt.rb
+++ b/lib/puppet/provider/package/apt.rb
@@ -16,10 +16,6 @@ Puppet::Type.type(:package).provide :apt, :parent => :dpkg do
# Debian boxes, and the only thing that differs is that it can
# install packages from remote sites.
- def aptcmd(*args)
- aptget(*args)
- end
-
def checkforcdrom
unless defined? @@checkedforcdrom
if FileTest.exists? "/etc/apt/sources.list"
@@ -73,9 +69,9 @@ Puppet::Type.type(:package).provide :apt, :parent => :dpkg do
end
end
- cmd << :install << str
+ cmd << 'install' << str
- aptcmd(cmd)
+ aptget(*cmd)
end
# What's the latest package version available?
@@ -127,9 +123,13 @@ Puppet::Type.type(:package).provide :apt, :parent => :dpkg do
end
def uninstall
- aptcmd "-y", "-q", :remove, @model[:name]
+ aptget "-y", "-q", :remove, @model[:name]
end
+ def purge
+ aptget '-y', '-q', 'remove', '--purge', @model[:name]
+ end
+
def versionable?
true
end
diff --git a/lib/puppet/provider/package/aptitude.rb b/lib/puppet/provider/package/aptitude.rb
index a959e34db..240c3fd82 100755
--- a/lib/puppet/provider/package/aptitude.rb
+++ b/lib/puppet/provider/package/aptitude.rb
@@ -6,7 +6,7 @@ Puppet::Type.type(:package).provide :aptitude, :parent => :apt do
ENV['DEBIAN_FRONTEND'] = "noninteractive"
- def aptcmd(*args)
+ def aptget(*args)
args.flatten!
# Apparently aptitude hasn't always supported a -q flag.
if args.include?("-q")
@@ -21,6 +21,10 @@ Puppet::Type.type(:package).provide :aptitude, :parent => :apt do
)
end
end
+
+ def purge
+ aptitude '-y', 'purge', @model[:name]
+ end
end
# $Id$
diff --git a/lib/puppet/provider/package/dpkg.rb b/lib/puppet/provider/package/dpkg.rb
index eb1911524..53b23ad64 100755
--- a/lib/puppet/provider/package/dpkg.rb
+++ b/lib/puppet/provider/package/dpkg.rb
@@ -100,6 +100,10 @@ Puppet::Type.type(:package).provide :dpkg do
def uninstall
dpkg "-r", @model[:name]
end
+
+ def purge
+ dpkg "--purge", @model[:name]
+ end
end
# $Id$
diff --git a/lib/puppet/type/package.rb b/lib/puppet/type/package.rb
index da4ec5db2..959520e1f 100644
--- a/lib/puppet/type/package.rb
+++ b/lib/puppet/type/package.rb
@@ -25,7 +25,11 @@ module Puppet
*latest* only makes sense for those packaging formats that can
retrieve new packages on their own and will throw an error on
those that cannot. For those packaging systems that allow you
- to specify package versions, specify them here."
+ to specify package versions, specify them here. Similarly,
+ *purged* is only useful for packaging systems that support
+ the notion of managing configuration files separately from
+ 'normal' system files. At present, only the Debian-related
+ providers (dpkg, apt, and aptitude) support *purged*."
attr_accessor :latest
@@ -36,6 +40,10 @@ module Puppet
newvalue(:absent, :event => :package_removed) do
provider.uninstall
end
+
+ newvalue(:purged, :event => :package_purged) do
+ provider.purge
+ end
# Alias the 'present' value.
aliasvalue(:installed, :present)