summaryrefslogtreecommitdiff
path: root/mkconfig.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-02 22:01:26 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-02 22:01:26 +0000
commit28155915a5ad8fecae349894a3445b0fdc876d58 (patch)
treef965b496f418aa6c9277dd301740ea4396386ec2 /mkconfig.rb
parent04ae31eb2412b79aba3d1cda13f4927e45700534 (diff)
* mkconfig.rb (patchlevel): config.status may not contain
PATCHLEVEL even if other version numbers exist. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21982 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'mkconfig.rb')
-rwxr-xr-xmkconfig.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/mkconfig.rb b/mkconfig.rb
index 49f892042b..c27c210557 100755
--- a/mkconfig.rb
+++ b/mkconfig.rb
@@ -38,6 +38,7 @@ v_fast = []
v_others = []
vars = {}
has_version = false
+has_patchlevel = false
continued_name = nil
continued_line = nil
File.foreach "config.status" do |line|
@@ -95,7 +96,12 @@ File.foreach "config.status" do |line|
else
v_others << v
end
- has_version = true if name == "MAJOR"
+ case name
+ when "MAJOR"
+ has_version = true
+ when "PATCHLEVEL"
+ has_patchlevel = true
+ end
end
# break if /^CEOF/
end
@@ -114,6 +120,8 @@ unless has_version
print " CONFIG[\"MINOR\"] = \"" + $2 + "\"\n"
print " CONFIG[\"TEENY\"] = \"" + $3 + "\"\n"
}
+end
+unless has_patchlevel
patchlevel = IO.foreach(File.join(srcdir, "version.h")) {|l|
m = /^\s*#\s*define\s+RUBY_PATCHLEVEL\s+(-?\d+)/.match(l) and break m[1]
}