From bf921512e288965724353ecf73ca9aa6d4975489 Mon Sep 17 00:00:00 2001 From: Jun Aruga Date: Fri, 26 Aug 2022 14:36:43 +0200 Subject: [PATCH] Make RDoc soft dependnecy in IRB. Resolves: rhbz#2119964 --- ruby-irb-1.4.1-drop-rdoc-hard-dep.patch | 24 +++++++++++++++ ruby-irb-1.4.1-set-rdoc-soft-dep.patch | 41 +++++++++++++++++++++++++ ruby.spec | 13 ++++++++ 3 files changed, 78 insertions(+) create mode 100644 ruby-irb-1.4.1-drop-rdoc-hard-dep.patch create mode 100644 ruby-irb-1.4.1-set-rdoc-soft-dep.patch diff --git a/ruby-irb-1.4.1-drop-rdoc-hard-dep.patch b/ruby-irb-1.4.1-drop-rdoc-hard-dep.patch new file mode 100644 index 0000000..711c514 --- /dev/null +++ b/ruby-irb-1.4.1-drop-rdoc-hard-dep.patch @@ -0,0 +1,24 @@ +From 54c8df06ff9e161012f89d19a4e3aa2e0e37e1b0 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?V=C3=ADt=20Ondruch?= +Date: Tue, 23 Aug 2022 10:41:28 +0200 +Subject: [PATCH] Drop hard dependency on RDoc. + +This has been introduced in 026700499dfd640b2072d7bf0370247a98d5ac40, +but it seems that this is just be mistake, otherwise the later handling +of `LoadError` would not be needed. +--- + lib/irb/input-method.rb | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/lib/irb/input-method.rb b/lib/irb/input-method.rb +index fd68239e..a8227caa 100644 +--- a/lib/irb/input-method.rb ++++ b/lib/irb/input-method.rb +@@ -14,7 +14,6 @@ + require_relative 'completion' + require 'io/console' + require 'reline' +-require 'rdoc' + + module IRB + STDIN_FILE_NAME = "(line)" # :nodoc: diff --git a/ruby-irb-1.4.1-set-rdoc-soft-dep.patch b/ruby-irb-1.4.1-set-rdoc-soft-dep.patch new file mode 100644 index 0000000..0156fe0 --- /dev/null +++ b/ruby-irb-1.4.1-set-rdoc-soft-dep.patch @@ -0,0 +1,41 @@ +From b24852058fc87c940252c8a711c60ae2eb298082 Mon Sep 17 00:00:00 2001 +From: Jun Aruga +Date: Thu, 25 Aug 2022 20:11:34 +0200 +Subject: [PATCH] Require RDoc in `input-method.rb` again in a limited scope. + +RDoc is implemented as soft dependency in IRB. See how the rdoc is required in +the files. I reverted the commit below. + +``` +$ grep -ril rdoc lib/ +lib/irb/cmd/help.rb +lib/irb/completion.rb +lib/irb/easter-egg.rb +lib/irb/input-method.rb +``` + +--- + +Revert "Remove `require` in signal handler to avoid ThreadError" + +This reverts commit 5f749c613c895cf1b11b5e4cbd1205363bc58028. +--- + lib/irb/input-method.rb | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/lib/irb/input-method.rb b/lib/irb/input-method.rb +index a8227ca..b77fd32 100644 +--- a/lib/irb/input-method.rb ++++ b/lib/irb/input-method.rb +@@ -320,6 +320,11 @@ def auto_indent(&block) + [195, 164], # The "ä" that appears when Alt+d is pressed on xterm. + [226, 136, 130] # The "∂" that appears when Alt+d in pressed on iTerm2. + ] ++ begin ++ require 'rdoc' ++ rescue LoadError ++ return nil ++ end + + if just_cursor_moving and completion_journey_data.nil? + return nil diff --git a/ruby.spec b/ruby.spec index 3de20eb..e2429ac 100644 --- a/ruby.spec +++ b/ruby.spec @@ -202,6 +202,12 @@ Patch25: ruby-rubygems-3.3.8-Resolve-cleaned-up-error-with-temporary-gemhome.pat # Fix tests with Europe/Amsterdam pre-1970 time on tzdata version 2022b. # https://github.com/ruby/spec/pull/939 Patch26: ruby-spec-Fix-tests-on-tzdata-2022b.patch +# Drop hard dependency on RDoc in IRB. +# https://github.com/ruby/irb/pull/393 +Patch27: ruby-irb-1.4.1-drop-rdoc-hard-dep.patch +# Set soft dependency on RDoc in input-method.rb in IRB. +# https://github.com/ruby/irb/pull/395 +Patch28: ruby-irb-1.4.1-set-rdoc-soft-dep.patch Requires: %{name}-libs%{?_isa} = %{version}-%{release} Suggests: rubypick @@ -354,6 +360,7 @@ Requires: ruby(rubygems) >= %{rubygems_version} # ruby-default-gems is required to run irb. # https://bugs.ruby-lang.org/issues/16951 Requires: ruby-default-gems >= %{ruby_version} +Recommends: rubygem(rdoc) >= %{rdoc_version} Provides: irb = %{version}-%{release} Provides: rubygem(irb) = %{version}-%{release} # Obsoleted by Ruby 2.6 in F30 timeframe. @@ -679,6 +686,8 @@ find .bundle/gems -name '*-[0-9]*.gemspec' -exec cp -t .bundle/specifications/ { %patch24 -p1 %patch25 -p1 %patch26 -p1 +%patch27 -p1 +%patch28 -p1 # Provide an example of usage of the tapset: cp -a %{SOURCE3} . @@ -1535,6 +1544,10 @@ mv test/fiddle/test_import.rb{,.disable} %changelog +* Mon Aug 29 2022 Jun Aruga - 3.1.2-168 +- Make RDoc soft dependnecy in IRB. + Resolves: rhbz#2119964 + * Wed Aug 24 2022 Jun Aruga - 3.1.2-168 - Fix tests with Europe/Amsterdam pre-1970 time on tzdata version 2022b. Resolves: rhbz#2120354