summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-28 02:30:13 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-28 02:30:13 +0000
commitb0e7ec8c9a06fa975cff864107af1e1c0780f19f (patch)
treee75c1619009d209d40fa3ab04d3cdb6b15f3cd6e /ext
parentc9f982d4e8d47b840378f349e680a20bc140a505 (diff)
extmk.rb: untouch makefiles
* ext/extmk.rb (extmake): leave makefiles untouched if the content is not changed, to get rid of unnecessary re-linking. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40973 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rwxr-xr-xext/extmk.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/extmk.rb b/ext/extmk.rb
index eda487c30e0..1ca5efd52cd 100755
--- a/ext/extmk.rb
+++ b/ext/extmk.rb
@@ -222,14 +222,14 @@ def extmake(target)
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