Land #8048, Only enumerate files during build

Only enumerate framework files in gemspec when building a gem
bug/bundler_fix
Jeffrey Martin 2017-03-09 11:56:12 -06:00
commit 8258680f95
No known key found for this signature in database
GPG Key ID: 0CD9BBC2AF15F171
1 changed files with 8 additions and 6 deletions

View File

@ -4,10 +4,14 @@
# we must manually define the project root # we must manually define the project root
if ENV['MSF_ROOT'] if ENV['MSF_ROOT']
lib = File.realpath(File.expand_path('lib', ENV['MSF_ROOT'])) lib = File.realpath(File.expand_path('lib', ENV['MSF_ROOT']))
files = `git ls-files`.split($/).reject { |file|
file =~ /^documentation|^data\/gui|^external/
}
else else
# have to use realpath as metasploit-framework is often loaded through a symlink and tools like Coverage and debuggers # have to use realpath as metasploit-framework is often loaded through a
# require realpaths. # symlink and tools like Coverage and debuggers require realpaths.
lib = File.realpath(File.expand_path('../lib', __FILE__)) lib = File.realpath(File.expand_path('../lib', __FILE__))
files = []
end end
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
@ -24,9 +28,7 @@ Gem::Specification.new do |spec|
spec.homepage = 'https://www.metasploit.com' spec.homepage = 'https://www.metasploit.com'
spec.license = 'BSD-3-clause' spec.license = 'BSD-3-clause'
spec.files = `git ls-files`.split($/).reject { |file| spec.files = files
file =~ /^documentation|^data\/gui|^external/
}
spec.bindir = '.' spec.bindir = '.'
if ENV['CREATE_BINSTUBS'] if ENV['CREATE_BINSTUBS']
spec.executables = [ spec.executables = [