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

ruby-changes:74473

From: Nobuyoshi <ko1@a...>
Date: Sun, 13 Nov 2022 20:00:35 +0900 (JST)
Subject: [ruby-changes:74473] 70c9d5b504 (master): Try to overwrite the file in VPATH if possible

https://git.ruby-lang.org/ruby.git/commit/?id=70c9d5b504

From 70c9d5b504525afd679cb45174e9544f150428a5 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Sun, 13 Nov 2022 18:05:11 +0900
Subject: Try to overwrite the file in VPATH if possible

---
 tool/lib/output.rb | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tool/lib/output.rb b/tool/lib/output.rb
index cbaa4b5a3e..3a9f3d87ae 100644
--- a/tool/lib/output.rb
+++ b/tool/lib/output.rb
@@ -28,7 +28,8 @@ class Output https://github.com/ruby/ruby/blob/trunk/tool/lib/output.rb#L28
     updated = color.fail("updated")
     outpath = nil
 
-    if @ifchange and (@vpath.open(@path, "rb") {|f| outpath = f.path; f.read == data} rescue false)
+    if (@ifchange or overwrite) and
+      (@vpath.open(@path, "rb") {|f| outpath = f.path; f.read == data if @ifchange} rescue false)
       puts "#{outpath} #{unchanged}"
       written = false
     else
-- 
cgit v1.2.3


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

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