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/azure-pipelines.yml b/azure-pipelines.yml index 2c96cd1..88c88f7 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -55,8 +55,8 @@ jobs: - default - software-updates - spotlight - - xcode-from-apple - - xcode-from-url + # - xcode-from-apple + # - xcode-from-url - command-line-tools - certificate - users 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 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' diff --git a/resources/command_line_tools.rb b/resources/command_line_tools.rb index 7bb53de..8e9d105 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] @@ -17,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 @@ -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] @@ -34,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