Skip to content

Commit f517b41

Browse files
[dpkg] add install_options feature
[dpkg] add uninstall_options feature [dpkg] uninstall_options, flags -> args array [dpkg] install_options, is an array, += args
1 parent 272abb9 commit f517b41

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

lib/puppet/provider/package/dpkg.rb

+10-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
and not `apt`, you must specify the source of any packages you want
88
to manage."
99

10-
has_feature :holdable, :virtual_packages
10+
has_feature :holdable, :virtual_packages, :install_options, :uninstall_options
1111
commands :dpkg => "/usr/bin/dpkg"
1212
commands :dpkg_deb => "/usr/bin/dpkg-deb"
1313
commands :dpkgquery => "/usr/bin/dpkg-query"
@@ -94,6 +94,10 @@ def install
9494

9595
args = []
9696

97+
if @resource[:install_options]
98+
args += @resource[:install_options]
99+
end
100+
97101
if @resource[:configfiles] == :keep
98102
args << '--force-confold'
99103
else
@@ -168,7 +172,11 @@ def query
168172
end
169173

170174
def uninstall
171-
dpkg "-r", @resource[:name]
175+
args = ["-r"]
176+
if @resource[:uninstall_options]
177+
args += @resource[:uninstall_options]
178+
end
179+
dpkg *args, @resource[:name]
172180
end
173181

174182
def purge

0 commit comments

Comments
 (0)