You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildr.apache.org by do...@apache.org on 2014/07/31 07:12:38 UTC

[24/50] git commit: Under windows, paths passed to mkpath, mkdir_p and mkdirs need to be normalized. Otherwise ruby may decide to treat the drive component as a directory (i.e. create a directory named "C:"). This patch hooks in at a low level to work ar

Under windows, paths passed to mkpath, mkdir_p and mkdirs need to be normalized. Otherwise ruby may decide to treat the drive component as a directory (i.e. create a directory named "C:"). This patch hooks in at a low level to work around this issue.

git-svn-id: https://svn.apache.org/repos/asf/buildr/trunk@1537858 13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/buildr/repo
Commit: http://git-wip-us.apache.org/repos/asf/buildr/commit/3766d17b
Tree: http://git-wip-us.apache.org/repos/asf/buildr/tree/3766d17b
Diff: http://git-wip-us.apache.org/repos/asf/buildr/diff/3766d17b

Branch: refs/heads/master
Commit: 3766d17bbdcb17a010c088f6db643d7e484b22b9
Parents: a4b12ac
Author: Peter Donald <do...@apache.org>
Authored: Fri Nov 1 09:22:54 2013 +0000
Committer: Peter Donald <do...@apache.org>
Committed: Fri Nov 1 09:22:54 2013 +0000

----------------------------------------------------------------------
 lib/buildr/core/application.rb | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/buildr/blob/3766d17b/lib/buildr/core/application.rb
----------------------------------------------------------------------
diff --git a/lib/buildr/core/application.rb b/lib/buildr/core/application.rb
index e2f103a..ab4cfdb 100644
--- a/lib/buildr/core/application.rb
+++ b/lib/buildr/core/application.rb
@@ -117,7 +117,7 @@ module Buildr
       @rakefiles = DEFAULT_BUILDFILES.dup
       @top_level_tasks = []
       @home_dir = File.expand_path('.buildr', ENV['HOME'])
-      mkpath @home_dir if !File.exist?(@home_dir) && File.writable?(ENV['HOME'])
+      mkpath Buildr::Util.normalize_path(@home_dir) if !File.exist?(@home_dir) && File.writable?(ENV['HOME'])
       @settings = Settings.new(self)
       @on_completion = []
       @on_failure = []
@@ -668,6 +668,18 @@ module Rake #:nodoc
   end
 end
 
+# Under windows, paths passed to mkpath, mkdir_p and mkdirs need to be normalized.
+# Otherwise ruby may decide to treat the drive component as a directory (i.e.
+# create a directory named "C:"). This patch hooks in at a low level to work around
+# this issue.
+module FileUtils
+  def fu_list(arg) #:nodoc:
+    [arg].flatten.map { |path| Buildr::Util.normalize_path(path) }
+  end
+
+  private_Fmodule_function :fu_list
+end
+
 module FileUtils
   def fu_output_message(msg)   #:nodoc:
     if Rake::FileUtilsExt::DEFAULT == RakeFileUtils.verbose_flag