зеркало из https://github.com/github/ruby.git
Revert "[ruby/fileutils] Fix #install with "X" mode option"
This reverts commit eab88d20ea
.
The some CI was broken with this.
This commit is contained in:
Родитель
5e9f08647c
Коммит
32e547954f
|
@ -917,8 +917,11 @@ module FileUtils
|
||||||
private_module_function :apply_mask
|
private_module_function :apply_mask
|
||||||
|
|
||||||
def symbolic_modes_to_i(mode_sym, path) #:nodoc:
|
def symbolic_modes_to_i(mode_sym, path) #:nodoc:
|
||||||
path = File.stat(path) unless File::Stat === path
|
mode = if File::Stat === path
|
||||||
mode = path.mode
|
path.mode
|
||||||
|
else
|
||||||
|
File.stat(path).mode
|
||||||
|
end
|
||||||
mode_sym.split(/,/).inject(mode & 07777) do |current_mode, clause|
|
mode_sym.split(/,/).inject(mode & 07777) do |current_mode, clause|
|
||||||
target, *actions = clause.split(/([=+-])/)
|
target, *actions = clause.split(/([=+-])/)
|
||||||
raise ArgumentError, "invalid file mode: #{mode_sym}" if actions.empty?
|
raise ArgumentError, "invalid file mode: #{mode_sym}" if actions.empty?
|
||||||
|
@ -935,7 +938,7 @@ module FileUtils
|
||||||
when "x"
|
when "x"
|
||||||
mask | 0111
|
mask | 0111
|
||||||
when "X"
|
when "X"
|
||||||
if path.directory?
|
if FileTest.directory? path
|
||||||
mask | 0111
|
mask | 0111
|
||||||
else
|
else
|
||||||
mask
|
mask
|
||||||
|
|
|
@ -1182,8 +1182,6 @@ class TestFileUtils < Test::Unit::TestCase
|
||||||
assert_filemode 04500, 'tmp/j'
|
assert_filemode 04500, 'tmp/j'
|
||||||
install 'tmp/j', 'tmp/k', :mode => "+s"
|
install 'tmp/j', 'tmp/k', :mode => "+s"
|
||||||
assert_filemode 06500, 'tmp/k'
|
assert_filemode 06500, 'tmp/k'
|
||||||
install 'tmp/a', 'tmp/l', :mode => "o+X"
|
|
||||||
assert_filemode 0644, 'tmp/l'
|
|
||||||
end if have_file_perm?
|
end if have_file_perm?
|
||||||
|
|
||||||
def test_chmod
|
def test_chmod
|
||||||
|
|
Загрузка…
Ссылка в новой задаче