aboutsummaryrefslogtreecommitdiffstats
path: root/main/ruby-bundler/manpages.patch
diff options
context:
space:
mode:
Diffstat (limited to 'main/ruby-bundler/manpages.patch')
-rw-r--r--main/ruby-bundler/manpages.patch30
1 files changed, 30 insertions, 0 deletions
diff --git a/main/ruby-bundler/manpages.patch b/main/ruby-bundler/manpages.patch
new file mode 100644
index 0000000000..e02e3275a6
--- /dev/null
+++ b/main/ruby-bundler/manpages.patch
@@ -0,0 +1,30 @@
+From: Jakub Jirutka <jakub@jirutka.cz>
+Date: Fri, 26 Mar 2021 23:17:29 +0100
+Subject: [PATCH] Fix --help when man pages are moved out
+
+Allow to move man pages from the gem's directory to the standard system
+location (/usr/share/man) without breaking `bundler --help`.
+
+--- a/lib/bundler/cli.rb
++++ b/lib/bundler/cli.rb
+@@ -123,8 +123,9 @@
+ end
+
+ man_path = File.expand_path("man", __dir__)
+- man_pages = Hash[Dir.glob(File.join(man_path, "**", "*")).grep(/.*\.\d*\Z/).collect do |f|
+- [File.basename(f, ".*"), f]
++ man_pages = Hash[Dir.glob(File.join(man_path, "**", "*")).grep(/.*\.\d*\.ronn\Z/).collect do |f|
++ man_name = File.basename(f, ".ronn")
++ [File.basename(man_name, ".*"), man_name]
+ end]
+
+ if man_pages.include?(command)
+@@ -132,7 +133,7 @@
+ if Bundler.which("man") && man_path !~ %r{^file:/.+!/META-INF/jruby.home/.+}
+ Kernel.exec "man #{man_page}"
+ else
+- puts File.read("#{man_path}/#{File.basename(man_page)}.ronn")
++ puts File.read("#{man_path}/#{man_page}.ronn")
+ end
+ elsif command_path = Bundler.which("bundler-#{cli}")
+ Kernel.exec(command_path, "--help")