mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
rbinstall.rb: umask hack
* tool/rbinstall.rb (Gem::Installer#install): moved umask hack. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a4fde3b60c
commit
8ebdec34ae
1 changed files with 7 additions and 9 deletions
|
@ -737,7 +737,12 @@ class Gem::Installer
|
||||||
install = instance_method(:install)
|
install = instance_method(:install)
|
||||||
define_method(:install) do
|
define_method(:install) do
|
||||||
spec.post_install_message = nil
|
spec.post_install_message = nil
|
||||||
install.bind(self).call
|
begin
|
||||||
|
u = File.umask(0022)
|
||||||
|
install.bind(self).call
|
||||||
|
ensure
|
||||||
|
File.umask(u)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
generate_bin_script = instance_method(:generate_bin_script)
|
generate_bin_script = instance_method(:generate_bin_script)
|
||||||
|
@ -845,14 +850,7 @@ install?(:ext, :comm, :gem, :'bundle-gems') do
|
||||||
inst = Gem::Installer.new(gem, options)
|
inst = Gem::Installer.new(gem, options)
|
||||||
inst.spec.extension_dir = with_destdir(inst.spec.extension_dir)
|
inst.spec.extension_dir = with_destdir(inst.spec.extension_dir)
|
||||||
begin
|
begin
|
||||||
Gem::DefaultUserInteraction.use_ui(silent) do
|
Gem::DefaultUserInteraction.use_ui(silent) {inst.install}
|
||||||
begin
|
|
||||||
File.umask(022)
|
|
||||||
inst.install
|
|
||||||
ensure
|
|
||||||
File.umask(0222)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
rescue Gem::InstallError => e
|
rescue Gem::InstallError => e
|
||||||
next
|
next
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue