Skip to content

Commit

Permalink
feat: add generated SPDX file on bottling
Browse files Browse the repository at this point in the history
  • Loading branch information
SMillerDev committed May 7, 2024
1 parent 802487d commit a43b746
Show file tree
Hide file tree
Showing 4 changed files with 446 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Library/Homebrew/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ end
group :man, optional: true do
gem "kramdown", require: false
end
group :pr_upload, optional: true do
group :pr_upload, :bottle, optional: true do
gem "json_schemer", require: false
end
group :prof, optional: true do
Expand Down
8 changes: 8 additions & 0 deletions Library/Homebrew/dev-cmd/bottle.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
require "formula"
require "utils/bottles"
require "tab"
require "sbom"
require "keg"
require "formula_versions"
require "utils/inreplace"
Expand Down Expand Up @@ -95,6 +96,8 @@ class Bottle < AbstractCommand

sig { override.void }
def run
Homebrew.install_bundler_gems!(groups: ["bottle"])

if args.merge?
Homebrew.install_bundler_gems!(groups: ["ast"])
return merge
Expand Down Expand Up @@ -491,6 +494,8 @@ def bottle_formula(formula)
Tab.clear_cache
Dependency.clear_cache
Requirement.clear_cache
SBOM.clear_cache

tab = keg.tab
original_tab = tab.dup
tab.poured_from_bottle = false
Expand All @@ -503,6 +508,9 @@ def bottle_formula(formula)
tab.write
end

sbom = SBOM.create(formula)
sbom.write

keg.consistent_reproducible_symlink_permissions!

cd cellar do
Expand Down

0 comments on commit a43b746

Please sign in to comment.