зеркало из https://github.com/github/ruby.git
rbinstall.rb: install files expanded from bundled gems
Although gemspec file (e.g., power_assert and rake) often uses `git ls-files`, as it does not make sense in other than its own repository, it has been ignored now. Gather all files expanded from the bundled gem to install, instead.
This commit is contained in:
Родитель
7817a438eb
Коммит
29dee10af2
|
@ -871,7 +871,7 @@ install?(:ext, :arch, :gem, :'default-gems', :'default-gems-arch') do
|
|||
install_default_gem('ext', srcdir)
|
||||
end
|
||||
|
||||
def load_gemspec(file)
|
||||
def load_gemspec(file, expanded = false)
|
||||
file = File.realpath(file)
|
||||
code = File.read(file, encoding: "utf-8:-")
|
||||
code.gsub!(/`git.*?`/m, '""')
|
||||
|
@ -881,6 +881,18 @@ def load_gemspec(file)
|
|||
raise TypeError, "[#{file}] isn't a Gem::Specification (#{spec.class} instead)."
|
||||
end
|
||||
spec.loaded_from = file
|
||||
|
||||
# gather expanded bundled gem files
|
||||
if expanded
|
||||
base = File.dirname(file)
|
||||
Dir.glob("**/*", File::FNM_DOTMATCH, base: base) do |n|
|
||||
next if n.start_with?(".git") # git related files are useless
|
||||
case File.basename(n); when ".", ".."; next; end
|
||||
next if File.directory?(File.join(base, n))
|
||||
spec.files << n
|
||||
end
|
||||
end
|
||||
|
||||
spec
|
||||
end
|
||||
|
||||
|
@ -955,7 +967,7 @@ install?(:ext, :comm, :gem, :'bundled-gems') do
|
|||
gem_name = "#$1-#$2"
|
||||
path = "#{srcdir}/.bundle/gems/#{gem_name}/#$1.gemspec"
|
||||
next unless File.exist?(path)
|
||||
spec = load_gemspec(path)
|
||||
spec = load_gemspec(path, true)
|
||||
next unless spec.platform == Gem::Platform::RUBY
|
||||
next unless spec.full_name == gem_name
|
||||
spec.extension_dir = "#{extensions_dir}/#{spec.full_name}"
|
||||
|
|
Загрузка…
Ссылка в новой задаче