Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions lib/puppet/provider/package/dpkg.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
and not `apt`, you must specify the source of any packages you want
to manage."

has_feature :holdable, :virtual_packages
has_feature :holdable, :virtual_packages, :install_options, :uninstall_options
commands :dpkg => "/usr/bin/dpkg"
commands :dpkg_deb => "/usr/bin/dpkg-deb"
commands :dpkgquery => "/usr/bin/dpkg-query"
Expand Down Expand Up @@ -94,6 +94,10 @@ def install

args = []

if @resource[:install_options]
args += @resource[:install_options]
end

if @resource[:configfiles] == :keep
args << '--force-confold'
else
Expand Down Expand Up @@ -168,7 +172,11 @@ def query
end

def uninstall
dpkg "-r", @resource[:name]
args = ["-r"]
if @resource[:uninstall_options]
args += @resource[:uninstall_options]
end
dpkg *args, @resource[:name]
end

def purge
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't sure if we want :uninstall_options for purge too, or if that would make things more difficult.

Expand Down