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

ruby-changes:37634

From: nobu <ko1@a...>
Date: Tue, 24 Feb 2015 13:59:10 +0900 (JST)
Subject: [ruby-changes:37634] nobu:r49715 (trunk): mkrunnable.rb: try mklink

nobu	2015-02-24 13:59:03 +0900 (Tue, 24 Feb 2015)

  New Revision: 49715

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

  Log:
    mkrunnable.rb: try mklink
    
    * tool/mkrunnable.rb (Mswin#ln_safe): try mklink command if not
      linked already.

  Modified files:
    trunk/tool/mkrunnable.rb
Index: tool/mkrunnable.rb
===================================================================
--- tool/mkrunnable.rb	(revision 49714)
+++ tool/mkrunnable.rb	(revision 49715)
@@ -19,6 +19,7 @@ module Mswin https://github.com/ruby/ruby/blob/trunk/tool/mkrunnable.rb#L19
   def ln_safe(src, dest, *opt)
     cmd = ["mklink", dest.tr("/", "\\"), src.tr("/", "\\")]
     cmd[1, 0] = opt
+    return if system("cmd", "/c", *cmd)
     # TODO: use RUNAS or something
     puts cmd.join(" ")
   end
@@ -64,12 +65,14 @@ def relative_path_from(path, base) https://github.com/ruby/ruby/blob/trunk/tool/mkrunnable.rb#L65
 end
 
 def ln_relative(src, dest)
+  return if File.identical?(src, dest)
   parent = File.dirname(dest)
   File.directory?(parent) or mkdir_p(parent)
   ln_safe(relative_path_from(src, parent), dest)
 end
 
 def ln_dir_relative(src, dest)
+  return if File.identical?(src, dest)
   parent = File.dirname(dest)
   File.directory?(parent) or mkdir_p(parent)
   ln_dir_safe(relative_path_from(src, parent), dest)

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

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