From 7cd2f1ac127d0669d314c0b6482d0ec8f4e665da Mon Sep 17 00:00:00 2001 From: Jared Weyer Date: Fri, 23 Jun 2023 12:30:03 -0700 Subject: [PATCH 1/4] use the file resource instead of fileUtils --- resources/command_line_tools.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/resources/command_line_tools.rb b/resources/command_line_tools.rb index 7bb53de..52be7a7 100644 --- a/resources/command_line_tools.rb +++ b/resources/command_line_tools.rb @@ -9,7 +9,10 @@ property :compile_time, [true, false], action :install do command_line_tools = CommandLineTools.new - command_line_tools.enable_install_on_demand + file 'create sentinel file' do + path '/tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress' + group 'wheel' + end execute "install #{command_line_tools.version}" do command ['softwareupdate', '--install', command_line_tools.version] @@ -26,7 +29,10 @@ end action :upgrade do command_line_tools = CommandLineTools.new - command_line_tools.enable_install_on_demand + file 'create sentinel file' do + path '/tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress' + group 'wheel' + end execute "upgrade #{command_line_tools.version}" do command ['softwareupdate', '--install', command_line_tools.latest_from_catalog] From f7feca1f2a09e80b337b0cc7d4ec918309155254 Mon Sep 17 00:00:00 2001 From: Jared Weyer Date: Fri, 23 Jun 2023 12:35:12 -0700 Subject: [PATCH 2/4] update monterey box version --- kitchen.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kitchen.yml b/kitchen.yml index 4a0595a..ea40a0a 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -43,7 +43,7 @@ platforms: - name: monterey-chef17 driver: box: microsoft/macos-monterey - box_version: 12.3.1 + box_version: 12.6.3 provisioner: product_version: 17 From 089714afd74ce68451df9bd11247d6071b457367 Mon Sep 17 00:00:00 2001 From: Jared Weyer Date: Fri, 23 Jun 2023 12:47:44 -0700 Subject: [PATCH 3/4] update clt ut --- resources/command_line_tools.rb | 4 ++-- spec/unit/resources/command_line_tools_spec.rb | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/resources/command_line_tools.rb b/resources/command_line_tools.rb index 52be7a7..8e9d105 100644 --- a/resources/command_line_tools.rb +++ b/resources/command_line_tools.rb @@ -20,7 +20,7 @@ action :install do live_stream true end - file 'sentinel to request on-demand install' do + file 'delete sentinel file' do path '/tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress' action :delete end @@ -40,7 +40,7 @@ action :upgrade do live_stream true end - file 'sentinel to request on-demand install' do + file 'delete sentinel file' do path '/tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress' action :delete end diff --git a/spec/unit/resources/command_line_tools_spec.rb b/spec/unit/resources/command_line_tools_spec.rb index 7ff0a9f..4c01e5b 100644 --- a/spec/unit/resources/command_line_tools_spec.rb +++ b/spec/unit/resources/command_line_tools_spec.rb @@ -21,7 +21,9 @@ describe 'command_line_tools' do end end + it { is_expected.to create_file('create sentinel file') } it { is_expected.to run_execute('install Command Line Tools (macOS High Sierra version 10.13) for Xcode-10.0') } + it { is_expected.to delete_file('delete sentinel file') } end context 'with libxcrun present' do @@ -35,7 +37,9 @@ describe 'command_line_tools' do end end + it { is_expected.to create_file('create sentinel file') } it { is_expected.to_not run_execute('install Command Line Tools (macOS High Sierra version 10.13) for Xcode-10.0') } + it { is_expected.to delete_file('delete sentinel file') } end end @@ -61,9 +65,11 @@ describe 'command_line_tools' do end end + it { is_expected.to create_file('create sentinel file') } it { is_expected.to run_execute('upgrade Command Line Tools for Xcode-11.0') .with(command: ['softwareupdate', '--install', 'Command Line Tools for Xcode-22.0']) } + it { is_expected.to delete_file('delete sentinel file') } end end From 4b0f64f035ad34ab345f7c5795f69383b0e22e49 Mon Sep 17 00:00:00 2001 From: Jared Weyer Date: Fri, 23 Jun 2023 12:49:19 -0700 Subject: [PATCH 4/4] update changelog & metadata --- CHANGELOG.md | 5 +++++ metadata.rb | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d9b8be..2332b5a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## [5.0.6] - 2023-06-23 + +### Fixed +- Fixed permissions issue with the `macos::command_line_tools` resource. + ## [5.0.5] - 2023-06-20 ### Fixed diff --git a/metadata.rb b/metadata.rb index 983e76d..e42e952 100644 --- a/metadata.rb +++ b/metadata.rb @@ -4,7 +4,7 @@ maintainer_email 'chef@microsoft.com' license 'MIT' description 'Resources for configuring and provisioning macOS' chef_version '>= 14.0' -version '5.0.5' +version '5.0.6' source_url 'https://github.com/Microsoft/macos-cookbook' issues_url 'https://github.com/Microsoft/macos-cookbook/issues'