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

ruby-changes:28921

From: nobu <ko1@a...>
Date: Tue, 28 May 2013 11:30:24 +0900 (JST)
Subject: [ruby-changes:28921] nobu:r40973 (trunk): extmk.rb: untouch makefiles

nobu	2013-05-28 11:30:13 +0900 (Tue, 28 May 2013)

  New Revision: 40973

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

  Log:
    extmk.rb: untouch makefiles
    
    * ext/extmk.rb (extmake): leave makefiles untouched if the content is
      not changed, to get rid of unnecessary re-linking.

  Modified files:
    trunk/ChangeLog
    trunk/ext/extmk.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 40972)
+++ ChangeLog	(revision 40973)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Tue May 28 11:30:02 2013  Nobuyoshi Nakada  <nobu@r...>
+
+	* ext/extmk.rb (extmake): leave makefiles untouched if the content is
+	  not changed, to get rid of unnecessary re-linking.
+
 Tue May 28 03:11:02 2013  Koichi Sasada  <ko1@a...>
 
 	* ext/objspace/gc_hook.c, ext/objspace/objspace.c: add new methods to
Index: ext/extmk.rb
===================================================================
--- ext/extmk.rb	(revision 40972)
+++ ext/extmk.rb	(revision 40973)
@@ -222,14 +222,14 @@ def extmake(target) https://github.com/ruby/ruby/blob/trunk/ext/extmk.rb#L222
     ok &&= File.open(makefile){|f| !f.gets[DUMMY_SIGNATURE]}
     ok = yield(ok) if block_given?
     if ok
-      open(makefile, "r+") do |f|
-        s = f.read.sub!(/^(static:)\s.*/, '\1 all')
+      open(makefile, "r+b") do |f|
+        s = f.read.sub!(/^(static:)\s(?!all\b).*/, '\1 all') or break
         f.rewind
         f.print(s)
         f.truncate(f.pos)
       end
     else
-      open(makefile, "w") do |f|
+      open(makefile, "wb") do |f|
         f.puts "# " + DUMMY_SIGNATURE
 	f.print(*dummy_makefile(CONFIG["srcdir"]))
       end

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

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