summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2021-01-12 13:04:14 -0800
committerGitHub <noreply@github.com>2021-01-12 13:04:14 -0800
commit4338395c4229f1d2c6e673fa2c3d43af11002e7c (patch)
tree4b029eadafdf772ac7d775b3e4d5d93198e7f641 /lib
parent5503c8f5f7eee96c8e22edf2542ababd87d40f0a (diff)
parentd89d3f0374a4e3027203df6ebcf21f690f263fc6 (diff)
downloadchef-4338395c4229f1d2c6e673fa2c3d43af11002e7c.tar.gz
Merge pull request #10867 from chef/fix_freebsd
adapt to FreeBSD pkgng sysexit changes
Diffstat (limited to 'lib')
-rw-r--r--lib/chef/provider/package/freebsd/pkgng.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/chef/provider/package/freebsd/pkgng.rb b/lib/chef/provider/package/freebsd/pkgng.rb
index 87acb3a830..077464b5c2 100644
--- a/lib/chef/provider/package/freebsd/pkgng.rb
+++ b/lib/chef/provider/package/freebsd/pkgng.rb
@@ -42,7 +42,9 @@ class Chef
end
def current_installed_version
- pkg_info = shell_out!("pkg", "info", new_resource.package_name, env: nil, returns: [0, 70])
+ # pkgng up to version 1.15.99.7 returns 70 for pkg not found,
+ # later versions return 1
+ pkg_info = shell_out!("pkg", "info", new_resource.package_name, env: nil, returns: [0, 1, 70])
pkg_info.stdout[/^Version +: (.+)$/, 1]
end