From f0314e0b993fdb862f86fd9ccd9087503619de9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A2u=20Cao?= Date: Sat, 11 Apr 2026 15:34:44 +0400 Subject: [PATCH] Update vendored cookbooks --- cookbooks/homebrew/.markdownlint-cli2.yaml | 2 + cookbooks/homebrew/CHANGELOG.md | 42 ++++++++++++++++++++ cookbooks/homebrew/libraries/helpers.rb | 45 ++++++---------------- cookbooks/homebrew/metadata.json | 4 +- cookbooks/homebrew/metadata.rb | 4 +- cookbooks/homebrew/renovate.json | 5 ++- cookbooks/homebrew/resources/cask.rb | 1 + cookbooks/homebrew/resources/tap.rb | 1 + 8 files changed, 64 insertions(+), 40 deletions(-) diff --git a/cookbooks/homebrew/.markdownlint-cli2.yaml b/cookbooks/homebrew/.markdownlint-cli2.yaml index 6fa8e77..0196ac7 100644 --- a/cookbooks/homebrew/.markdownlint-cli2.yaml +++ b/cookbooks/homebrew/.markdownlint-cli2.yaml @@ -3,3 +3,5 @@ config: line-length: false # MD013 no-duplicate-heading: false # MD024 reference-links-images: false # MD052 +ignores: + - .github/copilot-instructions.md diff --git a/cookbooks/homebrew/CHANGELOG.md b/cookbooks/homebrew/CHANGELOG.md index d179af1..31f072e 100644 --- a/cookbooks/homebrew/CHANGELOG.md +++ b/cookbooks/homebrew/CHANGELOG.md @@ -2,6 +2,48 @@ This file is used to list changes made in each version of the homebrew cookbook. +## 6.0.2 - *2025-09-04* + +Standardise files with files in sous-chefs/repo-management + +Standardise files with files in sous-chefs/repo-management + +## 6.0.1 - *2025-03-24* + +## 6.0.0 - *2025-03-17* + +- Updated library call for new homebrew class name found in chef-client 18.6.2+ releases + +## 5.4.9 - *2024-11-18* + +Standardise files with files in sous-chefs/repo-management + +Standardise files with files in sous-chefs/repo-management + +Standardise files with files in sous-chefs/repo-management + +Standardise files with files in sous-chefs/repo-management + +Standardise files with files in sous-chefs/repo-management + +## 5.4.8 - *2024-05-07* + +## 5.4.7 - *2024-05-06* + +- Explicitly include `Which` module from `Chef` which fixes runs on 18.x clients. + +## 5.4.6 - *2024-05-06* + +## 5.4.5 - *2023-11-01* + +Standardise files with files in sous-chefs/repo-management + +## 5.4.4 - *2023-09-28* + +## 5.4.3 - *2023-09-04* + +## 5.4.2 - *2023-07-10* + ## 5.4.1 - *2023-06-01* ## 5.4.0 - *2023-04-24* diff --git a/cookbooks/homebrew/libraries/helpers.rb b/cookbooks/homebrew/libraries/helpers.rb index 1699163..f958166 100644 --- a/cookbooks/homebrew/libraries/helpers.rb +++ b/cookbooks/homebrew/libraries/helpers.rb @@ -20,8 +20,9 @@ # class HomebrewUserWrapper - require 'chef/mixin/homebrew_user' - include Chef::Mixin::HomebrewUser + require 'chef/mixin/homebrew' + include Chef::Mixin::Homebrew + include Chef::Mixin::Which end module Homebrew @@ -59,41 +60,17 @@ module Homebrew def owner @owner ||= begin - # once we only support 14.0 we can switch this to find_homebrew_username - require 'etc' - ::Etc.getpwuid(HomebrewUserWrapper.new.find_homebrew_uid).name - rescue Chef::Exceptions::CannotDetermineHomebrewOwner - calculate_owner - end.tap do |owner| - Chef::Log.debug("Homebrew owner is #{owner}") - end - end - - private - - def calculate_owner - owner = homebrew_owner_attr || sudo_user || current_user - if owner == 'root' - raise Chef::Exceptions::User, - "Homebrew owner is 'root' which is not supported. " \ - "To set an explicit owner, please set node['homebrew']['owner']." - end - owner - end - - def homebrew_owner_attr - Chef.node['homebrew']['owner'] - end - - def sudo_user - ENV['SUDO_USER'] - end - - def current_user - ENV['USER'] + HomebrewUserWrapper.new.find_homebrew_username + rescue + Chef::Exceptions::CannotDetermineHomebrewPath + end.tap do |owner| + Chef::Log.debug("Homebrew owner is #{owner}") + end end end unless defined?(Homebrew) class HomebrewWrapper include Homebrew end + +Chef::Mixin::Homebrew.include(Homebrew) diff --git a/cookbooks/homebrew/metadata.json b/cookbooks/homebrew/metadata.json index 8ea519a..23c78ed 100644 --- a/cookbooks/homebrew/metadata.json +++ b/cookbooks/homebrew/metadata.json @@ -17,13 +17,13 @@ "recipes": { }, - "version": "5.4.1", + "version": "6.0.2", "source_url": "https://github.com/sous-chefs/homebrew", "issues_url": "https://github.com/sous-chefs/homebrew/issues", "privacy": false, "chef_versions": [ [ - ">= 15.3" + ">= 18.6.2" ] ], "ohai_versions": [ diff --git a/cookbooks/homebrew/metadata.rb b/cookbooks/homebrew/metadata.rb index 9af47f4..204cca8 100644 --- a/cookbooks/homebrew/metadata.rb +++ b/cookbooks/homebrew/metadata.rb @@ -3,9 +3,9 @@ maintainer 'Sous Chefs' maintainer_email 'help@sous-chefs.org' license 'Apache-2.0' description 'Install Homebrew and includes resources for working with taps and casks' -version '5.4.1' +version '6.0.2' supports 'mac_os_x' source_url 'https://github.com/sous-chefs/homebrew' issues_url 'https://github.com/sous-chefs/homebrew/issues' -chef_version '>= 15.3' +chef_version '>= 18.6.2' diff --git a/cookbooks/homebrew/renovate.json b/cookbooks/homebrew/renovate.json index 7e7a8ba..a0b29c8 100644 --- a/cookbooks/homebrew/renovate.json +++ b/cookbooks/homebrew/renovate.json @@ -1,9 +1,10 @@ { "$schema": "https://docs.renovatebot.com/renovate-schema.json", "extends": ["config:base"], - "packageRules": [{ + "packageRules": [ + { "groupName": "Actions", - "matchUpdateTypes": ["patch", "pin", "digest"], + "matchUpdateTypes": ["minor", "patch", "pin"], "automerge": true, "addLabels": ["Release: Patch", "Skip: Announcements"] }, diff --git a/cookbooks/homebrew/resources/cask.rb b/cookbooks/homebrew/resources/cask.rb index c4d2053..f66fc8f 100644 --- a/cookbooks/homebrew/resources/cask.rb +++ b/cookbooks/homebrew/resources/cask.rb @@ -19,6 +19,7 @@ # limitations under the License. # +unified_mode true chef_version_for_provides '< 14.0' if respond_to?(:chef_version_for_provides) property :cask_name, String, regex: %r{^[\w/-]+$}, name_property: true diff --git a/cookbooks/homebrew/resources/tap.rb b/cookbooks/homebrew/resources/tap.rb index 8f67124..dc7f329 100644 --- a/cookbooks/homebrew/resources/tap.rb +++ b/cookbooks/homebrew/resources/tap.rb @@ -19,6 +19,7 @@ # limitations under the License. # +unified_mode true chef_version_for_provides '< 14.0' if respond_to?(:chef_version_for_provides) property :tap_name, String, name_property: true, regex: %r{^[\w-]+(?:\/[\w-]+)+$}