summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2022-03-31 09:49:41 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2022-03-31 10:49:55 +0900
commitabfd859b139545110e1fcdd8e99575d5e0bfb4e4 (patch)
treebf4731f0f0ecbc94bf5e949853badd5592986ddd
parentc499a4c28a62813752aeb894d68d92fcec850ac0 (diff)
Remove github and git related files from extracted bundled gems
-rw-r--r--common.mk3
-rw-r--r--defs/gmake.mk1
2 files changed, 3 insertions, 1 deletions
diff --git a/common.mk b/common.mk
index 0ea274179e..9068a298a6 100644
--- a/common.mk
+++ b/common.mk
@@ -1358,12 +1358,13 @@ update-gems$(gnumake:yes=-nongnumake): PHONY
extract-gems$(gnumake:yes=-nongnumake): PHONY
$(ECHO) Extracting bundled gem files...
$(Q) $(RUNRUBY) -C "$(srcdir)" \
- -Itool -rgem-unpack -answ \
+ -Itool -rfileutils -rgem-unpack -answ \
-e 'BEGIN {FileUtils.mkdir_p(d = ".bundle/gems")}' \
-e 'gem, ver = *$$F' \
-e 'next if !ver or /^#/=~gem' \
-e 'g = "#{gem}-#{ver}"' \
-e 'File.directory?("#{d}/#{g}") or Gem.unpack("gems/#{g}.gem", d)' \
+ -e 'FileUtils.rm_rf("#{d}/#{g}/.github")' \
gems/bundled_gems
update-bundled_gems: PHONY
diff --git a/defs/gmake.mk b/defs/gmake.mk
index c32fee0a6c..a625379a68 100644
--- a/defs/gmake.mk
+++ b/defs/gmake.mk
@@ -296,6 +296,7 @@ extract-gems: | $(patsubst %,.bundle/gems/%,$(bundled-gems))
$(Q) $(BASERUBY) -C "$(srcdir)" \
-Itool -rgem-unpack \
-e 'Gem.unpack("gems/$(@F).gem", ".bundle/gems")'
+ $(RMALL) "$(srcdir)/$(@:.gem=)/".git*
$(srcdir)/.bundle/gems:
$(MAKEDIRS) $@