[前][次][番号順一覧][スレッド一覧]

ruby-changes:46109

From: nagachika <ko1@a...>
Date: Tue, 28 Mar 2017 01:57:43 +0900 (JST)
Subject: [ruby-changes:46109] nagachika:r58180 (ruby_2_3): merge revision(s) 57640: [Backport #13214]

nagachika	2017-03-28 01:57:39 +0900 (Tue, 28 Mar 2017)

  New Revision: 58180

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=58180

  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_3/
  Modified files:
    branches/ruby_2_3/lib/fileutils.rb
    branches/ruby_2_3/test/fileutils/test_fileutils.rb
    branches/ruby_2_3/version.h
Index: ruby_2_3/version.h
===================================================================
--- ruby_2_3/version.h	(revision 58179)
+++ ruby_2_3/version.h	(revision 58180)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_3/version.h#L1
 #define RUBY_VERSION "2.3.3"
 #define RUBY_RELEASE_DATE "2017-03-28"
-#define RUBY_PATCHLEVEL 289
+#define RUBY_PATCHLEVEL 290
 
 #define RUBY_RELEASE_YEAR 2017
 #define RUBY_RELEASE_MONTH 3
Index: ruby_2_3/test/fileutils/test_fileutils.rb
===================================================================
--- ruby_2_3/test/fileutils/test_fileutils.rb	(revision 58179)
+++ ruby_2_3/test/fileutils/test_fileutils.rb	(revision 58180)
@@ -903,6 +903,24 @@ class TestFileUtils < Test::Unit::TestCa https://github.com/ruby/ruby/blob/trunk/ruby_2_3/test/fileutils/test_fileutils.rb#L903
     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_3/lib/fileutils.rb
===================================================================
--- ruby_2_3/lib/fileutils.rb	(revision 58179)
+++ ruby_2_3/lib/fileutils.rb	(revision 58180)
@@ -222,6 +222,7 @@ module FileUtils https://github.com/ruby/ruby/blob/trunk/ruby_2_3/lib/fileutils.rb#L222
         stack.push path
         path = File.dirname(path)
       end
+      stack.pop                 # root directory should exist
       stack.reverse_each do |dir|
         begin
           fu_mkdir dir, options[:mode]

Property changes on: ruby_2_3
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r57640


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]