summaryrefslogtreecommitdiff
path: root/tool/outdate-bundled-gems.rb
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2022-12-13 22:06:02 -0800
committerTakashi Kokubun <takashikkbn@gmail.com>2022-12-13 22:07:42 -0800
commitabf9a321823184f73a5aaf3c8e25291e75f94a84 (patch)
tree6791e7b9901e12355f50922bcc4c27e4534e27f0 /tool/outdate-bundled-gems.rb
parent2d5b723b2f69dda8c7cf0de69c25e16a1818b88c (diff)
downloadruby-abf9a321823184f73a5aaf3c8e25291e75f94a84.tar.gz
Match ABI versions precisely
"3.2.0+33" starts with "3.2.0+3", but it doesn't mean that they are the same ABI version.
Diffstat (limited to 'tool/outdate-bundled-gems.rb')
-rwxr-xr-xtool/outdate-bundled-gems.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/tool/outdate-bundled-gems.rb b/tool/outdate-bundled-gems.rb
index 3c519cc461..bf6b268700 100755
--- a/tool/outdate-bundled-gems.rb
+++ b/tool/outdate-bundled-gems.rb
@@ -109,20 +109,21 @@ curdir.glob(".bundle/{extensions,.timestamp}/*/") do |dir|
end
end
-version = RbConfig::CONFIG['ruby_version']
+baseruby_version = RbConfig::CONFIG['ruby_version'] # This may not have "-static"
curdir.glob(".bundle/{extensions,.timestamp}/#{platform}/*/") do |dir|
- unless File.basename(dir).start_with?(version)
+ version = File.basename(dir).split('-', 2).first # Remove "-static" if exists
+ unless version == baseruby_version
curdir.rmdir(dir)
end
end
-curdir.glob(".bundle/extensions/#{platform}/#{version}/*/") do |dir|
+curdir.glob(".bundle/extensions/#{platform}/#{baseruby_version}/*/") do |dir|
unless curdir.exist?(".bundle/specifications/#{File.basename(dir)}.gemspec")
curdir.rmdir(dir)
end
end
-curdir.glob(".bundle/.timestamp/#{platform}/#{version}/.*.time") do |stamp|
+curdir.glob(".bundle/.timestamp/#{platform}/#{baseruby_version}/.*.time") do |stamp|
unless curdir.directory?(File.join(".bundle", stamp[%r[/\.([^/]+)\.time\z], 1].gsub('.-.', '/')))
curdir.unlink(stamp)
end