Skip to content

Commit

Permalink
[dpkg] add install_options feature
Browse files Browse the repository at this point in the history
[dpkg] add uninstall_options feature

[dpkg] uninstall_options, flags -> args array

[dpkg] install_options, is an array, += args
  • Loading branch information
clundquist-stripe committed Apr 11, 2024
1 parent 272abb9 commit f517b41
Showing 1 changed file with 10 additions and 2 deletions.
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
Expand Down

0 comments on commit f517b41

Please sign in to comment.