Skip to content

Commit c819029

Browse files
authored
Fix double-prefixed path in outdate-bundled-gems.rb (ruby#16531)
When building with a relative srcdir (e.g., ../configure from a build directory), default_gem? was called with an already-prefixed path on line 149. Since default_gem? internally calls prefixed() again, this resulted in a double prefix (e.g., ../../.bundle/... instead of ../.bundle/...), causing an ENOENT error. Also fix line 156 to use curdir.default_gem? instead of srcdir, since the spec comes from curdir.glob and should be resolved against curdir.
1 parent 3b8317e commit c819029

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

tool/outdate-bundled-gems.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,14 +146,14 @@ def each_directory
146146

147147
srcdir.glob(".bundle/specifications/*.gemspec") do |spec|
148148
unless srcdir.directory?(".bundle/gems/#{File.basename(spec, '.gemspec')}/")
149-
next if srcdir.default_gem?(srcdir.prefixed(spec))
149+
next if srcdir.default_gem?(spec)
150150
srcdir.unlink(spec)
151151
end
152152
end
153153

154154
curdir.glob(".bundle/specifications/*.gemspec") do |spec|
155155
unless srcdir.directory?(".bundle/gems/#{File.basename(spec, '.gemspec')}")
156-
next if srcdir.default_gem?(curdir.prefixed(spec))
156+
next if curdir.default_gem?(spec)
157157
curdir.unlink(spec)
158158
end
159159
end

0 commit comments

Comments
 (0)