From f517b419ef70611cb9897453aed2b9a9cf2d3fdf Mon Sep 17 00:00:00 2001 From: Chris Lundquist Date: Mon, 8 Jan 2024 13:58:24 -0800 Subject: [PATCH] [dpkg] add install_options feature [dpkg] add uninstall_options feature [dpkg] uninstall_options, flags -> args array [dpkg] install_options, is an array, += args --- lib/puppet/provider/package/dpkg.rb | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/puppet/provider/package/dpkg.rb b/lib/puppet/provider/package/dpkg.rb index 017e351bb8f..50ccf55f89f 100644 --- a/lib/puppet/provider/package/dpkg.rb +++ b/lib/puppet/provider/package/dpkg.rb @@ -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" @@ -94,6 +94,10 @@ def install args = [] + if @resource[:install_options] + args += @resource[:install_options] + end + if @resource[:configfiles] == :keep args << '--force-confold' else @@ -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