ruby-changes:46510
From: nagachika <ko1@a...>
Date: Wed, 10 May 2017 00:02:54 +0900 (JST)
Subject: [ruby-changes:46510] nagachika:r58631 (ruby_2_4): merge revision(s) 57640: [Backport #13214]
nagachika 2017-05-09 23:56:38 +0900 (Tue, 09 May 2017) New Revision: 58631 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=58631 Log: merge revision(s) 57640: [Backport #13214] fileutils.rb: do not make root * lib/fileutils.rb (FileUtils#mkdir_p): no need to make root directory which should be exist and cannot be made with mkdir recent Cygwin can make a directory contains a colon. [Bug #13214] Modified directories: branches/ruby_2_4/ Modified files: branches/ruby_2_4/lib/fileutils.rb branches/ruby_2_4/test/fileutils/test_fileutils.rb branches/ruby_2_4/version.h Index: ruby_2_4/lib/fileutils.rb =================================================================== --- ruby_2_4/lib/fileutils.rb (revision 58630) +++ ruby_2_4/lib/fileutils.rb (revision 58631) @@ -202,6 +202,7 @@ module FileUtils https://github.com/ruby/ruby/blob/trunk/ruby_2_4/lib/fileutils.rb#L202 stack.push path path = File.dirname(path) end + stack.pop # root directory should exist stack.reverse_each do |dir| begin fu_mkdir dir, mode Index: ruby_2_4/version.h =================================================================== --- ruby_2_4/version.h (revision 58630) +++ ruby_2_4/version.h (revision 58631) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_4/version.h#L1 #define RUBY_VERSION "2.4.2" #define RUBY_RELEASE_DATE "2017-05-09" -#define RUBY_PATCHLEVEL 125 +#define RUBY_PATCHLEVEL 126 #define RUBY_RELEASE_YEAR 2017 #define RUBY_RELEASE_MONTH 5 Index: ruby_2_4/test/fileutils/test_fileutils.rb =================================================================== --- ruby_2_4/test/fileutils/test_fileutils.rb (revision 58630) +++ ruby_2_4/test/fileutils/test_fileutils.rb (revision 58631) @@ -905,6 +905,24 @@ class TestFileUtils < Test::Unit::TestCa https://github.com/ruby/ruby/blob/trunk/ruby_2_4/test/fileutils/test_fileutils.rb#L905 mkdir_p '/' end + if /mswin|mingw|cygwin/ =~ RUBY_PLATFORM + def test_mkdir_p_root + if /cygwin/ =~ RUBY_PLATFORM + tmpdir = `cygpath -ma .`.chomp + else + tmpdir = Dir.pwd + end + skip "No drive letter" unless /\A[a-z]:/i =~ tmpdir + drive = "./#{$&}" + assert_file_not_exist drive + mkdir_p "#{tmpdir}/none/dir" + assert_directory "none/dir" + assert_file_not_exist drive + ensure + Dir.rmdir(drive) if drive and File.directory?(drive) + end + end + def test_mkdir_p_file_perm mkdir_p 'tmp/tmp/tmp', :mode => 07777 assert_directory 'tmp/tmp/tmp' Index: ruby_2_4 =================================================================== --- ruby_2_4 (revision 58630) +++ ruby_2_4 (revision 58631) Property changes on: ruby_2_4 ___________________________________________________________________ Modified: svn:mergeinfo ## -0,0 +0,1 ## Merged /trunk:r57640 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/