diff options
author | Tim Smith <tsmith@chef.io> | 2020-03-16 10:52:54 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-16 10:52:54 -0700 |
commit | 5501175398faf8cc6c41e465f8f2e16679882398 (patch) | |
tree | bb66ecd1c76cc40277e1638eb975e1ab012c68d7 | |
parent | f6d1337a0221bc30b51bd711ed2795c647e61fc6 (diff) | |
parent | 691dcaf222ee438b001cfd9a0b8153281bfe9bff (diff) | |
download | chef-5501175398faf8cc6c41e465f8f2e16679882398.tar.gz |
Merge pull request #9490 from chef/smaller_builds
Cleanup a bunch more files and pull in the smaller license-acceptance
-rw-r--r-- | Gemfile.lock | 2 | ||||
-rw-r--r-- | omnibus/Gemfile.lock | 2 | ||||
-rw-r--r-- | omnibus/config/software/more-ruby-cleanup.rb | 34 |
3 files changed, 35 insertions, 3 deletions
diff --git a/Gemfile.lock b/Gemfile.lock index 62bb21ad03..95d02401a9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -248,7 +248,7 @@ GEM regexp_parser (~> 1.5) uri_template (~> 0.7) libyajl2 (1.2.0) - license-acceptance (1.0.13) + license-acceptance (1.0.18) pastel (~> 0.7) tomlrb (~> 1.2) tty-box (~> 0.3) diff --git a/omnibus/Gemfile.lock b/omnibus/Gemfile.lock index ac23f40e7b..fc2a5edad1 100644 --- a/omnibus/Gemfile.lock +++ b/omnibus/Gemfile.lock @@ -193,7 +193,7 @@ GEM kitchen-vagrant (1.6.1) test-kitchen (>= 1.4, < 3) libyajl2 (1.2.0) - license-acceptance (1.0.13) + license-acceptance (1.0.18) pastel (~> 0.7) tomlrb (~> 1.2) tty-box (~> 0.3) diff --git a/omnibus/config/software/more-ruby-cleanup.rb b/omnibus/config/software/more-ruby-cleanup.rb index 7fab72fca2..46bf36624b 100644 --- a/omnibus/config/software/more-ruby-cleanup.rb +++ b/omnibus/config/software/more-ruby-cleanup.rb @@ -68,6 +68,9 @@ build do features *Upgrade.md vendor + *.blurb + autotest + VERSION } Dir.glob(Dir.glob("#{target_dir}/*/{#{files.join(",")}}")).each do |f| @@ -78,4 +81,33 @@ build do FileUtils.rm_rf(f) end end -end
\ No newline at end of file + + block "Removing Gemspec / Rakefile / Gemfile unless there's a bin dir / not a chef gem" do + # find the embedded ruby gems dir and clean it up for globbing + target_dir = "#{install_dir}/embedded/lib/ruby/gems/*/gems".tr('\\', "/") + files = %w{ + *.gemspec + Gemfile + Rakefile + tasks + } + + Dir.glob(Dir.glob("#{target_dir}/*/{#{files.join(",")}}")).each do |f| + # don't delete these files if there's a bin dir in the same dir or we're in a chef owned gem + next if Dir.exist?(File.join(File.dirname(f), "bin")) || File.basename(File.expand_path("..", f)).start_with?("chef-") + + puts "Deleting #{f}" + FileUtils.rm_rf(f) + end + end + + block "Removing spec dirs from non-Chef gems" do + Dir.glob(Dir.glob("#{install_dir}/embedded/lib/ruby/gems/*/gems/*/spec".tr('\\', "/"))).each do |f| + # if we're in a chef- gem then don't remove the specs + next if File.basename(File.expand_path("..", f)).start_with?("chef-") + + puts "Deleting #{f}" + FileUtils.rm_rf(f) + end + end +end |