Skip to content

Commit

Permalink
Remove duplicate gem cleanup + pull in smaller omnibus sofware defs
Browse files Browse the repository at this point in the history
Cleanup of the gem installs that is handled in omnibus-software has been removed
Add some new cleanup we're doing in chef/chef that shaves a few more files from the install
Bring in the new omnibus-software
  - libxml2 without debug support
  - libxslt without debug and profiler support

Signed-off-by: Tim Smith <tsmith@chef.io>
  • Loading branch information
tas50 committed Jul 31, 2020
1 parent 227329c commit 311ce72
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
4 changes: 2 additions & 2 deletions omnibus/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
GIT
remote: https://github.com/chef/omnibus-software.git
revision: 41ddd2e5d20a95fc9ee8344a9cdd57f85dfe47b1
revision: f1c903b899df38ff8e5445ae1cd6483fcbafdea7
branch: master
specs:
omnibus-software (4.0.0)
Expand Down Expand Up @@ -32,7 +32,7 @@ GEM
artifactory (3.0.15)
awesome_print (1.8.0)
aws-eventstream (1.1.0)
aws-partitions (1.348.0)
aws-partitions (1.349.0)
aws-sdk-core (3.104.3)
aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.239.0)
Expand Down
14 changes: 11 additions & 3 deletions omnibus/config/software/more-ruby-cleanup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,21 @@
# find the embedded ruby gems dir and clean it up for globbing
target_dir = "#{install_dir}/embedded/lib/ruby/gems/*/gems".tr('\\', "/")
files = %w{
.rspec-tm
.sitearchdir.time
*-public_cert.pem
.dockerignore
bootstrap.sh
ci
diagrams
example
examples
ext
Gemfile.lock
java
patches
playbooks
perf
rakelib
sample
samples
Expand All @@ -60,7 +68,7 @@
warning.txt
}

Dir.glob(Dir.glob("#{target_dir}/*/{#{files.join(",")}}")).each do |f|
Dir.glob("#{target_dir}/*/{#{files.join(",")}}").each do |f|
puts "Deleting #{f}"
FileUtils.rm_rf(f)
end
Expand All @@ -76,7 +84,7 @@
tasks
}

Dir.glob(Dir.glob("#{target_dir}/*/{#{files.join(",")}}")).each do |f|
Dir.glob("#{target_dir}/*/{#{files.join(",")}}").each do |f|
# don't delete these files if there's a non-empty bin dir in the same dir
next if Dir.exist?(File.join(File.dirname(f), "bin")) && !Dir.empty?(File.join(File.dirname(f), "bin"))

Expand All @@ -89,7 +97,7 @@
# find the embedded ruby gems dir and clean it up for globbing
target_dir = "#{install_dir}/embedded/lib/ruby/gems/*/gems".tr('\\', "/")

Dir.glob(Dir.glob("#{target_dir}/*/spec")).each do |f|
Dir.glob("#{target_dir}/*/spec").each do |f|

# don't delete these files if we use them in our verify tests
unless File.basename(File.expand_path("..", f)).match?(/^(berkshelf|test-kitchen|chef|chef-cli|chef-apply|chefspec)-\d/)
Expand Down

0 comments on commit 311ce72

Please sign in to comment.