blob: e8df04cc0735389401e06828ef0e174eb7d448c1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
$NetBSD: patch-ae,v 1.3 2015/06/08 16:47:54 taca Exp $
* Try load from PKG_SYSCONFDIR/dot.rd2rc.
* Depend on $0 strictly.
--- bin/rd2.orig 2015-06-04 13:21:12.000000000 +0000
+++ bin/rd2
@@ -67,6 +67,7 @@ output_file = nil
output_index = nil
out_code = nil
from_rdo = nil
+sysconf = "@PKG_SYSCONFDIR@/dot.rd2rc"
# user option
$DEFAULT_FORMAT_LIB = "rd/rd2html-lib"
@@ -77,10 +78,10 @@ begin
load "~/.rd2rc"
# STDERR << "#{$0}: loading ~/.rd2rc\n"
else
- load "rd/dot.rd2rc"
+ load sysconf
# STDERR << "#{$0}: loading rd/dot.rd2rc\n"
end
-rescue
+rescue StandardError, LoadError
load "rd/dot.rd2rc"
end
@@ -161,8 +162,8 @@ ARGV.options do |q|
end # OptionParser.new
# require format lib implicitly
-if /rd2.+/ =~ File.basename($0, ".*").downcase
- visitor_lib = "rd/" + $& + "-lib.rb"
+if /rd2[0-9]*([a-z-]+).*/ =~ File.basename($0, ".*").downcase
+ visitor_lib = "rd/rd2" + $1 + "-lib.rb"
require visitor_lib
require $RD2_Sub_OptionParser if $RD2_Sub_OptionParser
# make visitor
|