summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md11
-rw-r--r--Gemfile.lock24
-rw-r--r--VERSION2
-rw-r--r--chef-bin/lib/chef-bin/version.rb2
-rw-r--r--chef-config/lib/chef-config/version.rb2
-rw-r--r--chef-utils/lib/chef-utils/version.rb2
-rw-r--r--distro/ruby_bin_folder/AMD64/Chef.PowerShell.Wrapper.dllbin169984 -> 169984 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/Chef.PowerShell.dllbin6144 -> 6144 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/3.1.8/Chef.PowerShell.Wrapper.Core.dllbin97792 -> 97792 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/3.1.8/Chef.Powershell.Core.dllbin5632 -> 5632 bytes
-rw-r--r--distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/3.1.8/Chef.Powershell.Core.pdbbin1404 -> 1404 bytes
-rw-r--r--distro/ruby_bin_folder/x86/Chef.PowerShell.dllbin6656 -> 6656 bytes
-rw-r--r--distro/ruby_bin_folder/x86/Chef.Powershell.Wrapper.dllbin144896 -> 145920 bytes
-rw-r--r--distro/ruby_bin_folder/x86/concrt140.dllbin244608 -> 244088 bytes
-rw-r--r--distro/ruby_bin_folder/x86/msvcp140.dllbin448384 -> 450952 bytes
-rw-r--r--distro/ruby_bin_folder/x86/msvcp140_1.dllbin21384 -> 21376 bytes
-rw-r--r--distro/ruby_bin_folder/x86/msvcp140_2.dllbin166792 -> 166776 bytes
-rw-r--r--distro/ruby_bin_folder/x86/msvcp140_atomic_wait.dllbin0 -> 39296 bytes
-rw-r--r--distro/ruby_bin_folder/x86/msvcp140_codecvt_ids.dllbin18824 -> 18808 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/3.1.8/Chef.PowerShell.Wrapper.Core.dllbin82944 -> 83456 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/3.1.8/Chef.Powershell.Core.dllbin6144 -> 6144 bytes
-rw-r--r--distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/3.1.8/Chef.Powershell.Core.pdbbin1408 -> 1408 bytes
-rw-r--r--distro/ruby_bin_folder/x86/vccorlib140.dllbin267648 -> 267656 bytes
-rw-r--r--distro/ruby_bin_folder/x86/vcruntime140.dllbin76168 -> 76152 bytes
-rw-r--r--lib/chef/powershell.rb10
-rw-r--r--lib/chef/provider/group.rb16
-rw-r--r--lib/chef/provider/group/windows.rb13
-rw-r--r--lib/chef/provider/package/zypper.rb6
-rw-r--r--lib/chef/resource/build_essential.rb13
-rw-r--r--lib/chef/version.rb2
-rw-r--r--spec/unit/provider/group/windows_spec.rb6
-rw-r--r--spec/unit/provider/group_spec.rb2
-rw-r--r--spec/unit/provider/mount_spec.rb3
-rw-r--r--spec/unit/resource/build_essential_spec.rb12
-rw-r--r--spec/unit/resource/data/InstallHistory_with_CLT.plist92
-rw-r--r--spec/unit/resource/data/InstallHistory_without_CLT.plist38
36 files changed, 70 insertions, 186 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index efff003064..25c9b4cf80 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,15 +1,20 @@
<!-- usage documentation: http://expeditor-docs.es.chef.io/configuration/changelog/ -->
-<!-- latest_release 16.7.41 -->
-## [v16.7.41](https://github.com/chef/chef/tree/v16.7.41) (2020-11-12)
+<!-- latest_release 16.7.46 -->
+## [v16.7.46](https://github.com/chef/chef/tree/v16.7.46) (2020-11-14)
#### Merged Pull Requests
-- Update omnibus to remove the chef-sugar dep [#10629](https://github.com/chef/chef/pull/10629) ([tas50](https://github.com/tas50))
+- Fix idempotency issues in build_essential on the mac [#10647](https://github.com/chef/chef/pull/10647) ([tas50](https://github.com/tas50))
<!-- latest_release -->
<!-- release_rollup since=16.6.14 -->
### Changes not yet released to stable
#### Merged Pull Requests
+- Fix idempotency issues in build_essential on the mac [#10647](https://github.com/chef/chef/pull/10647) ([tas50](https://github.com/tas50)) <!-- 16.7.46 -->
+- Fix zypper_package CI failures [#10648](https://github.com/chef/chef/pull/10648) ([lamont-granquist](https://github.com/lamont-granquist)) <!-- 16.7.45 -->
+- pull in v0.2.1 of powershell shim that fixes .net resolver [#10644](https://github.com/chef/chef/pull/10644) ([mwrock](https://github.com/mwrock)) <!-- 16.7.44 -->
+- Fix group output and windows support [#10642](https://github.com/chef/chef/pull/10642) ([jaymzh](https://github.com/jaymzh)) <!-- 16.7.43 -->
+- mount: changes to fix solaris test failure [#10643](https://github.com/chef/chef/pull/10643) ([antima-gupta](https://github.com/antima-gupta)) <!-- 16.7.42 -->
- Update omnibus to remove the chef-sugar dep [#10629](https://github.com/chef/chef/pull/10629) ([tas50](https://github.com/tas50)) <!-- 16.7.41 -->
- knife bootstrap deps require net/ssh [#10638](https://github.com/chef/chef/pull/10638) ([vsingh-msys](https://github.com/vsingh-msys)) <!-- 16.7.40 -->
- Change how zypper_package calculates the candidate_version [#10631](https://github.com/chef/chef/pull/10631) ([lamont-granquist](https://github.com/lamont-granquist)) <!-- 16.7.39 -->
diff --git a/Gemfile.lock b/Gemfile.lock
index f3b360febd..e9f137e850 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -28,12 +28,12 @@ GIT
PATH
remote: .
specs:
- chef (16.7.41)
+ chef (16.7.46)
addressable
bcrypt_pbkdf (= 1.1.0.rc1)
bundler (>= 1.10)
- chef-config (= 16.7.41)
- chef-utils (= 16.7.41)
+ chef-config (= 16.7.46)
+ chef-utils (= 16.7.46)
chef-vault
chef-zero (>= 14.0.11)
diff-lcs (>= 1.2.4, < 1.4.0)
@@ -64,12 +64,12 @@ PATH
tty-screen (~> 0.6)
tty-table (~> 0.11)
uuidtools (~> 2.1.5)
- chef (16.7.41-universal-mingw32)
+ chef (16.7.46-universal-mingw32)
addressable
bcrypt_pbkdf (= 1.1.0.rc1)
bundler (>= 1.10)
- chef-config (= 16.7.41)
- chef-utils (= 16.7.41)
+ chef-config (= 16.7.46)
+ chef-utils (= 16.7.46)
chef-vault
chef-zero (>= 14.0.11)
diff-lcs (>= 1.2.4, < 1.4.0)
@@ -115,15 +115,15 @@ PATH
PATH
remote: chef-bin
specs:
- chef-bin (16.7.41)
- chef (= 16.7.41)
+ chef-bin (16.7.46)
+ chef (= 16.7.46)
PATH
remote: chef-config
specs:
- chef-config (16.7.41)
+ chef-config (16.7.46)
addressable
- chef-utils (= 16.7.41)
+ chef-utils (= 16.7.46)
fuzzyurl
mixlib-config (>= 2.2.12, < 4.0)
mixlib-shellout (>= 2.0, < 4.0)
@@ -132,7 +132,7 @@ PATH
PATH
remote: chef-utils
specs:
- chef-utils (16.7.41)
+ chef-utils (16.7.46)
GEM
remote: https://rubygems.org/
@@ -172,7 +172,7 @@ GEM
ecma-re-validator (0.2.1)
regexp_parser (~> 1.2)
ed25519 (1.2.4)
- erubi (1.9.0)
+ erubi (1.10.0)
erubis (2.7.0)
faraday (1.0.1)
multipart-post (>= 1.2, < 3)
diff --git a/VERSION b/VERSION
index 845c7b912f..62ed53bd73 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-16.7.41 \ No newline at end of file
+16.7.46 \ No newline at end of file
diff --git a/chef-bin/lib/chef-bin/version.rb b/chef-bin/lib/chef-bin/version.rb
index 996939f53d..89a98c362e 100644
--- a/chef-bin/lib/chef-bin/version.rb
+++ b/chef-bin/lib/chef-bin/version.rb
@@ -21,7 +21,7 @@
module ChefBin
CHEFBIN_ROOT = File.expand_path("..", __dir__)
- VERSION = "16.7.41".freeze
+ VERSION = "16.7.46".freeze
end
#
diff --git a/chef-config/lib/chef-config/version.rb b/chef-config/lib/chef-config/version.rb
index cdf125614a..d3e4acbbff 100644
--- a/chef-config/lib/chef-config/version.rb
+++ b/chef-config/lib/chef-config/version.rb
@@ -15,5 +15,5 @@
module ChefConfig
CHEFCONFIG_ROOT = File.expand_path("..", __dir__)
- VERSION = "16.7.41".freeze
+ VERSION = "16.7.46".freeze
end
diff --git a/chef-utils/lib/chef-utils/version.rb b/chef-utils/lib/chef-utils/version.rb
index e163aff114..76d83068ac 100644
--- a/chef-utils/lib/chef-utils/version.rb
+++ b/chef-utils/lib/chef-utils/version.rb
@@ -16,5 +16,5 @@
module ChefUtils
CHEFUTILS_ROOT = File.expand_path("..", __dir__)
- VERSION = "16.7.41"
+ VERSION = "16.7.46"
end
diff --git a/distro/ruby_bin_folder/AMD64/Chef.PowerShell.Wrapper.dll b/distro/ruby_bin_folder/AMD64/Chef.PowerShell.Wrapper.dll
index 0a5d80632c..4b1a0dd692 100644
--- a/distro/ruby_bin_folder/AMD64/Chef.PowerShell.Wrapper.dll
+++ b/distro/ruby_bin_folder/AMD64/Chef.PowerShell.Wrapper.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/Chef.PowerShell.dll b/distro/ruby_bin_folder/AMD64/Chef.PowerShell.dll
index 1143fe1175..19f5e0f1ed 100644
--- a/distro/ruby_bin_folder/AMD64/Chef.PowerShell.dll
+++ b/distro/ruby_bin_folder/AMD64/Chef.PowerShell.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/3.1.8/Chef.PowerShell.Wrapper.Core.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/3.1.8/Chef.PowerShell.Wrapper.Core.dll
index 52beb787b3..e8f475c3dc 100644
--- a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/3.1.8/Chef.PowerShell.Wrapper.Core.dll
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/3.1.8/Chef.PowerShell.Wrapper.Core.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/3.1.8/Chef.Powershell.Core.dll b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/3.1.8/Chef.Powershell.Core.dll
index 0c07278003..573150ab44 100644
--- a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/3.1.8/Chef.Powershell.Core.dll
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/3.1.8/Chef.Powershell.Core.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/3.1.8/Chef.Powershell.Core.pdb b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/3.1.8/Chef.Powershell.Core.pdb
index 2479087bd2..244a59acc4 100644
--- a/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/3.1.8/Chef.Powershell.Core.pdb
+++ b/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/3.1.8/Chef.Powershell.Core.pdb
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/Chef.PowerShell.dll b/distro/ruby_bin_folder/x86/Chef.PowerShell.dll
index 70dc1a0318..6e405d878f 100644
--- a/distro/ruby_bin_folder/x86/Chef.PowerShell.dll
+++ b/distro/ruby_bin_folder/x86/Chef.PowerShell.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/Chef.Powershell.Wrapper.dll b/distro/ruby_bin_folder/x86/Chef.Powershell.Wrapper.dll
index 4f243e70bc..f148f6e6a5 100644
--- a/distro/ruby_bin_folder/x86/Chef.Powershell.Wrapper.dll
+++ b/distro/ruby_bin_folder/x86/Chef.Powershell.Wrapper.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/concrt140.dll b/distro/ruby_bin_folder/x86/concrt140.dll
index 5649eefca4..1d75093197 100644
--- a/distro/ruby_bin_folder/x86/concrt140.dll
+++ b/distro/ruby_bin_folder/x86/concrt140.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/msvcp140.dll b/distro/ruby_bin_folder/x86/msvcp140.dll
index 053520472c..76529d554a 100644
--- a/distro/ruby_bin_folder/x86/msvcp140.dll
+++ b/distro/ruby_bin_folder/x86/msvcp140.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/msvcp140_1.dll b/distro/ruby_bin_folder/x86/msvcp140_1.dll
index 3e027a48f2..4dfe3ee783 100644
--- a/distro/ruby_bin_folder/x86/msvcp140_1.dll
+++ b/distro/ruby_bin_folder/x86/msvcp140_1.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/msvcp140_2.dll b/distro/ruby_bin_folder/x86/msvcp140_2.dll
index 6baf5a6019..8f251b32cc 100644
--- a/distro/ruby_bin_folder/x86/msvcp140_2.dll
+++ b/distro/ruby_bin_folder/x86/msvcp140_2.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/msvcp140_atomic_wait.dll b/distro/ruby_bin_folder/x86/msvcp140_atomic_wait.dll
new file mode 100644
index 0000000000..4c758375f7
--- /dev/null
+++ b/distro/ruby_bin_folder/x86/msvcp140_atomic_wait.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/msvcp140_codecvt_ids.dll b/distro/ruby_bin_folder/x86/msvcp140_codecvt_ids.dll
index 128405f0f8..efa73e134b 100644
--- a/distro/ruby_bin_folder/x86/msvcp140_codecvt_ids.dll
+++ b/distro/ruby_bin_folder/x86/msvcp140_codecvt_ids.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/3.1.8/Chef.PowerShell.Wrapper.Core.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/3.1.8/Chef.PowerShell.Wrapper.Core.dll
index 510e99770d..0d282b5d39 100644
--- a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/3.1.8/Chef.PowerShell.Wrapper.Core.dll
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/3.1.8/Chef.PowerShell.Wrapper.Core.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/3.1.8/Chef.Powershell.Core.dll b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/3.1.8/Chef.Powershell.Core.dll
index c97035476a..1b53a46076 100644
--- a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/3.1.8/Chef.Powershell.Core.dll
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/3.1.8/Chef.Powershell.Core.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/3.1.8/Chef.Powershell.Core.pdb b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/3.1.8/Chef.Powershell.Core.pdb
index fe5122be63..269329e5f2 100644
--- a/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/3.1.8/Chef.Powershell.Core.pdb
+++ b/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/3.1.8/Chef.Powershell.Core.pdb
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/vccorlib140.dll b/distro/ruby_bin_folder/x86/vccorlib140.dll
index f41c246b46..f9933d56ac 100644
--- a/distro/ruby_bin_folder/x86/vccorlib140.dll
+++ b/distro/ruby_bin_folder/x86/vccorlib140.dll
Binary files differ
diff --git a/distro/ruby_bin_folder/x86/vcruntime140.dll b/distro/ruby_bin_folder/x86/vcruntime140.dll
index 9958562d2d..dc526fc062 100644
--- a/distro/ruby_bin_folder/x86/vcruntime140.dll
+++ b/distro/ruby_bin_folder/x86/vcruntime140.dll
Binary files differ
diff --git a/lib/chef/powershell.rb b/lib/chef/powershell.rb
index 4800708dfc..905b92ebfb 100644
--- a/lib/chef/powershell.rb
+++ b/lib/chef/powershell.rb
@@ -63,15 +63,7 @@ class Chef
def exec(script)
FFI.ffi_lib @dll
FFI.attach_function :execute_powershell, :ExecuteScript, [:string], :pointer
- # This is a temporary fix for running in a Habitat environment
- # In habitat we set CHEF_POWERSHELL_BIN so that .Net resolves our
- # managed shim assembly from the correct location.
- # It seems that that is preventing .Net from successfully loading GAC assemblies
- # and can break all sorts of edge (and not so edge) scenarios. Once we are actually
- # inside the powershell run space, we know our shim was loaded and can unset
- # CHEF_POWERSHELL_BIN which will bypass our custom resolver logic. The real fix is
- # to fix our resolver. Oh and OH MY GOD this was a pain to track down.
- execution = FFI.execute_powershell("$ENV:CHEF_POWERSHELL_BIN=$NULL;#{script}").read_utf16string
+ execution = FFI.execute_powershell(script).read_utf16string
hashed_outcome = Chef::JSONCompat.parse(execution)
@result = Chef::JSONCompat.parse(hashed_outcome["result"])
@errors = hashed_outcome["errors"]
diff --git a/lib/chef/provider/group.rb b/lib/chef/provider/group.rb
index 905a22dc33..9e3d7f9a00 100644
--- a/lib/chef/provider/group.rb
+++ b/lib/chef/provider/group.rb
@@ -78,7 +78,7 @@ class Chef
# <false>:: If a change is not required
def compare_group
@change_desc = [ ]
- if new_resource.gid.to_s != current_resource.gid.to_s
+ unless group_gid_match?
@change_desc << "change gid #{current_resource.gid} to #{new_resource.gid}"
end
@@ -103,13 +103,21 @@ class Chef
unless members_to_be_removed.empty?
@change_desc << "remove existing member(s): #{members_to_be_removed.join(", ")}"
end
- elsif new_resource.members != current_resource.members
- @change_desc << "replace group members with new list of members"
+ elsif !group_members_match?
+ @change_desc << "replace group members with new list of members: #{new_resource.members.join(", ")}"
end
!@change_desc.empty?
end
+ def group_gid_match?
+ new_resource.gid.to_s == current_resource.gid.to_s
+ end
+
+ def group_members_match?
+ [new_resource.members].flatten.sort == [current_resource.members].flatten.sort
+ end
+
def has_current_group_member?(member)
current_resource.members.include?(member)
end
@@ -131,7 +139,7 @@ class Chef
if compare_group
converge_by(["alter group #{new_resource.group_name}"] + change_desc) do
manage_group
- logger.info("#{new_resource} altered")
+ logger.info("#{new_resource} altered: #{change_desc.join(", ")}")
end
end
end
diff --git a/lib/chef/provider/group/windows.rb b/lib/chef/provider/group/windows.rb
index 45914b16e3..dacfc348f7 100644
--- a/lib/chef/provider/group/windows.rb
+++ b/lib/chef/provider/group/windows.rb
@@ -33,6 +33,17 @@ class Chef
@net_group = Chef::Util::Windows::NetGroup.new(new_resource.group_name)
end
+ def group_members_match?
+ sorted_members_sids = new_resource.members.map { |x| lookup_account_name(x) }.sort
+ sorted_current_sids = current_resource.members.sort
+ Chef::Log.debug("#{new_resource.name}: current_members: #{sorted_current_sids} vs new_members #{sorted_members_sids}")
+ sorted_members_sids == sorted_current_sids
+ end
+
+ def group_gid_match?
+ true
+ end
+
def load_current_resource
@current_resource = Chef::Resource::Group.new(new_resource.name)
current_resource.group_name(new_resource.group_name)
@@ -74,7 +85,7 @@ class Chef
members_to_be_removed << member if has_current_group_member?(member)
end
@net_group.local_delete_members(members_to_be_removed) unless members_to_be_removed.empty?
- else
+ elsif !group_members_match?
@net_group.local_set_members(new_resource.members)
end
@net_group.local_group_set_info(new_resource.comment) if new_resource.comment
diff --git a/lib/chef/provider/package/zypper.rb b/lib/chef/provider/package/zypper.rb
index 6ed7339e32..a1a433cbdf 100644
--- a/lib/chef/provider/package/zypper.rb
+++ b/lib/chef/provider/package/zypper.rb
@@ -103,6 +103,12 @@ class Chef
(status, name, type, version, arch, repo) = [ md[1], md[2], md[3], md[4], md[5], md[6] ]
next if version == "Version" # header
+ # sometimes even though we request a specific version in the search string above and have match exact, we wind up
+ # with other versions in the output, particularly getting the installed version when downgrading.
+ if new_version
+ next unless version == new_version || version.start_with?("#{new_version}-")
+ end
+
return version
end
end
diff --git a/lib/chef/resource/build_essential.rb b/lib/chef/resource/build_essential.rb
index 17b97ebd97..3039f709c8 100644
--- a/lib/chef/resource/build_essential.rb
+++ b/lib/chef/resource/build_essential.rb
@@ -15,7 +15,6 @@
#
require_relative "../resource"
-autoload :Plist, "plist"
class Chef
class Resource
@@ -130,8 +129,8 @@ class Chef
pkg_label = xcode_cli_package_label
# With upgrade action we should install if it's not installed or if there's an available update.
- # `xcode_cli_package_label` will be nil if there's no update.
- install_xcode_cli_tools(pkg_label) if !xcode_cli_installed? || xcode_cli_package_label
+ # `pkg_label` will be nil if there's no update.
+ install_xcode_cli_tools(pkg_label) if !xcode_cli_installed? || pkg_label
else
Chef::Log.info "The build_essential resource :upgrade action is only supported on macOS systems. Skipping..."
end
@@ -160,14 +159,12 @@ class Chef
end
#
- # Determine if the XCode Command Line Tools are installed by parsing the install history plist.
- # We parse the plist data install of running pkgutil because we found that pkgutils doesn't always contain all the packages
+ # Determine if the XCode Command Line Tools are installed by checking
+ # for success from `xcode-select -p`
#
# @return [true, false]
def xcode_cli_installed?
- packages = ::Plist.parse_xml(::File.open("/Library/Receipts/InstallHistory.plist", "r"))
- packages.select! { |package| package["displayName"].match? "Command Line Tools" }
- !packages.empty?
+ !shell_out("xcode-select", "-p").error?
end
#
diff --git a/lib/chef/version.rb b/lib/chef/version.rb
index 986f54e05e..e08c127ee1 100644
--- a/lib/chef/version.rb
+++ b/lib/chef/version.rb
@@ -23,7 +23,7 @@ require_relative "version_string"
class Chef
CHEF_ROOT = File.expand_path("..", __dir__)
- VERSION = Chef::VersionString.new("16.7.41")
+ VERSION = Chef::VersionString.new("16.7.46")
end
#
diff --git a/spec/unit/provider/group/windows_spec.rb b/spec/unit/provider/group/windows_spec.rb
index 61853c90bd..85b88000a8 100644
--- a/spec/unit/provider/group/windows_spec.rb
+++ b/spec/unit/provider/group/windows_spec.rb
@@ -39,6 +39,12 @@ describe Chef::Provider::Group::Windows do
end
describe "when creating the group" do
+ before do
+ @current_resource = Chef::Resource::Group.new("staff")
+ @current_resource.members %w{all your base}
+ @provider.current_resource = @current_resource
+ end
+
it "should call @net_group.local_add" do
expect(@net_group).to receive(:local_set_members).with([])
expect(@net_group).to receive(:local_add)
diff --git a/spec/unit/provider/group_spec.rb b/spec/unit/provider/group_spec.rb
index 76fde1e141..a3701c1f45 100644
--- a/spec/unit/provider/group_spec.rb
+++ b/spec/unit/provider/group_spec.rb
@@ -266,7 +266,7 @@ describe Chef::Provider::User do
@new_resource.members << "user1"
allow(@new_resource).to receive(:append).and_return false
expect(@provider.compare_group).to be_truthy
- expect(@provider.change_desc).to eq([ "replace group members with new list of members" ])
+ expect(@provider.change_desc).to eq([ "replace group members with new list of members: aj, user1" ])
end
it "should report the gid will be changed when it does not match" do
diff --git a/spec/unit/provider/mount_spec.rb b/spec/unit/provider/mount_spec.rb
index 47bab39e66..7800d0c666 100644
--- a/spec/unit/provider/mount_spec.rb
+++ b/spec/unit/provider/mount_spec.rb
@@ -207,7 +207,8 @@ describe Chef::Provider::Mount do
expect { provider.disable_fs }.to raise_error(Chef::Exceptions::UnsupportedAction)
end
- describe "#device_unchanged?" do
+ # Not supported on solaris because it can't cope with a LABEL device type.
+ describe "#device_unchanged?", :not_supported_on_solaris do
it "should be true when device_type not changed" do
expect(provider.device_unchanged?).to be_truthy
end
diff --git a/spec/unit/resource/build_essential_spec.rb b/spec/unit/resource/build_essential_spec.rb
index 547b4dfc3c..f366ceb557 100644
--- a/spec/unit/resource/build_essential_spec.rb
+++ b/spec/unit/resource/build_essential_spec.rb
@@ -57,18 +57,6 @@ describe Chef::Resource::BuildEssential do
end
end
- describe "#xcode_cli_installed?" do
- it "returns true if the CLI is in the InstallHistory plist" do
- allow(::File).to receive(:open).with("/Library/Receipts/InstallHistory.plist", "r").and_return(::File.join(::File.dirname(__FILE__), "data/InstallHistory_with_CLT.plist"))
- expect(provider.xcode_cli_installed?).to eql(true)
- end
-
- it "returns false if the pkgutil doesn't list the package" do
- allow(::File).to receive(:open).with("/Library/Receipts/InstallHistory.plist", "r").and_return(::File.join(::File.dirname(__FILE__), "data/InstallHistory_without_CLT.plist"))
- expect(provider.xcode_cli_installed?).to eql(false)
- end
- end
-
describe "#xcode_cli_package_label" do
it "returns a package name on macOS < 10.15" do
allow(provider).to receive(:shell_out).with("softwareupdate", "--list").and_return(softwareupdate_pre_catalina)
diff --git a/spec/unit/resource/data/InstallHistory_with_CLT.plist b/spec/unit/resource/data/InstallHistory_with_CLT.plist
deleted file mode 100644
index 402c8f344d..0000000000
--- a/spec/unit/resource/data/InstallHistory_with_CLT.plist
+++ /dev/null
@@ -1,92 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<array>
- <dict>
- <key>contentType</key>
- <string>config-data</string>
- <key>date</key>
- <date>2019-10-07T20:09:37Z</date>
- <key>displayName</key>
- <string>XProtectPlistConfigData</string>
- <key>displayVersion</key>
- <string>2106</string>
- <key>packageIdentifiers</key>
- <array>
- <string>com.apple.pkg.XProtectPlistConfigData_10_15.16U4081</string>
- </array>
- <key>processName</key>
- <string>softwareupdated</string>
- </dict>
- <dict>
- <key>contentType</key>
- <string>config-data</string>
- <key>date</key>
- <date>2019-10-07T20:09:37Z</date>
- <key>displayName</key>
- <string>Gatekeeper Configuration Data</string>
- <key>displayVersion</key>
- <string>181</string>
- <key>packageIdentifiers</key>
- <array>
- <string>com.apple.pkg.GatekeeperConfigData.16U1873</string>
- </array>
- <key>processName</key>
- <string>softwareupdated</string>
- </dict>
- <dict>
- <key>contentType</key>
- <string>config-data</string>
- <key>date</key>
- <date>2019-10-07T20:09:37Z</date>
- <key>displayName</key>
- <string>MRTConfigData</string>
- <key>displayVersion</key>
- <string>1.50</string>
- <key>packageIdentifiers</key>
- <array>
- <string>com.apple.pkg.MRTConfigData_10_15.16U4082</string>
- </array>
- <key>processName</key>
- <string>softwareupdated</string>
- </dict>
- <dict>
- <key>date</key>
- <date>2019-10-09T02:37:33Z</date>
- <key>displayName</key>
- <string>Chef Infra Client</string>
- <key>displayVersion</key>
- <string></string>
- <key>packageIdentifiers</key>
- <array>
- <string>com.getchef.pkg.chef</string>
- </array>
- <key>processName</key>
- <string>installer</string>
- </dict>
- <dict>
- <key>date</key>
- <date>2019-10-09T02:47:02Z</date>
- <key>displayName</key>
- <string>Command Line Tools for Xcode</string>
- <key>displayVersion</key>
- <string>11.0</string>
- <key>packageIdentifiers</key>
- <array>
- <string>com.apple.pkg.CLTools_Executables</string>
- <string>com.apple.pkg.CLTools_SDK_macOS1015</string>
- <string>com.apple.pkg.CLTools_SDK_macOS1014</string>
- <string>com.apple.pkg.CLTools_macOS_SDK</string>
- <string>com.apple.pkg.DevSDK</string>
- <string>com.apple.pkg.DevSDK_OSX109</string>
- <string>com.apple.pkg.DevSDK_OSX1010</string>
- <string>com.apple.pkg.DevSDK_OSX1011</string>
- <string>com.apple.pkg.DevSDK_OSX1012</string>
- <string>com.apple.pkg.DevSDK_macOS1013_Public</string>
- <string>com.apple.pkg.macOS_SDK_headers_for_macOS_10.14</string>
- </array>
- <key>processName</key>
- <string>softwareupdated</string>
- </dict>
-</array>
-</plist>
diff --git a/spec/unit/resource/data/InstallHistory_without_CLT.plist b/spec/unit/resource/data/InstallHistory_without_CLT.plist
deleted file mode 100644
index 2cc10d63ff..0000000000
--- a/spec/unit/resource/data/InstallHistory_without_CLT.plist
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<array>
- <dict>
- <key>contentType</key>
- <string>config-data</string>
- <key>date</key>
- <date>2019-09-30T20:36:29Z</date>
- <key>displayName</key>
- <string>Gatekeeper Configuration Data</string>
- <key>displayVersion</key>
- <string>181</string>
- <key>packageIdentifiers</key>
- <array>
- <string>com.apple.pkg.GatekeeperConfigData.16U1873</string>
- </array>
- <key>processName</key>
- <string>softwareupdated</string>
- </dict>
- <dict>
- <key>contentType</key>
- <string>config-data</string>
- <key>date</key>
- <date>2019-09-30T20:36:29Z</date>
- <key>displayName</key>
- <string>MRTConfigData</string>
- <key>displayVersion</key>
- <string>1.49</string>
- <key>packageIdentifiers</key>
- <array>
- <string>com.apple.pkg.MRTConfigData_10_15.16U4080</string>
- </array>
- <key>processName</key>
- <string>softwareupdated</string>
- </dict>
-</array>
-</plist>