Skip to content

Commit 1203ad0

Browse files
frikilusersorah
authored andcommitted
Add patch to fix ENOENT error when cwd does not exists
(Closes: #969130)
1 parent 9873f8a commit 1203ad0

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
From: Antoni Villalonga <[email protected]>
2+
Date: Fri, 28 Aug 2020 02:09:42 +0200
3+
Subject: Rescue getcwd ENOENT error
4+
Forwarded: not-needed
5+
Bug-Debian: http://bugs.debian.org/969130
6+
Upstream-Author: David Rodríguez
7+
8+
Rescue ENOENT error allowing run ruby scripts when cwd does not exists.
9+
Cherry-pick from upstream 96064e6f1ce100a37680dc8f9509f06b3350e9c8
10+
11+
--- a/lib/rubygems/bundler_version_finder.rb
12+
+++ b/lib/rubygems/bundler_version_finder.rb
13+
@@ -82,12 +82,19 @@
14+
def self.lockfile_contents
15+
gemfile = ENV["BUNDLE_GEMFILE"]
16+
gemfile = nil if gemfile && gemfile.empty?
17+
- Gem::Util.traverse_parents Dir.pwd do |directory|
18+
- next unless gemfile = Gem::GEM_DEP_FILES.find { |f| File.file?(f.tap(&Gem::UNTAINT)) }
19+
20+
- gemfile = File.join directory, gemfile
21+
- break
22+
- end unless gemfile
23+
+ unless gemfile
24+
+ begin
25+
+ Gem::Util.traverse_parents(Dir.pwd) do |directory|
26+
+ next unless gemfile = Gem::GEM_DEP_FILES.find { |f| File.file?(f.tap(&Gem::UNTAINT)) }
27+
+
28+
+ gemfile = File.join directory, gemfile
29+
+ break
30+
+ end
31+
+ rescue Errno::ENOENT
32+
+ return
33+
+ end
34+
+ end
35+
36+
return unless gemfile
37+

debian/patches/series

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@
77
0007-Fix-FTBFS-on-x32-misdetected-as-i386-or-amd64.patch
88
0010-Fix-IRBTestIRBHistory-tests.patch
99
0012-Dont-use-relative-path.patch
10+
0010-Fix-getcwd-ENOENT.patch

0 commit comments

Comments
 (0)