reap 5.0.0 → 5.10.10
Sign up to get free protection for your applications and to get access to all the features.
- data/ANN +3 -0
- data/COPYING +11 -0
- data/ChangeLog +25 -0
- data/ProjectInfo +41 -66
- data/README +125 -0
- data/Rakefile +0 -10
- data/bin/reap +3 -4
- data/data/reap/scaffold/COPYING +11 -0
- data/data/reap/scaffold/{standard/ChangeLog → ChangeLog} +0 -0
- data/data/reap/scaffold/{standard/TODO → INSTALL} +0 -0
- data/data/reap/scaffold/{standard/ProjectInfo → ProjectInfo} +20 -20
- data/data/reap/scaffold/{subversion/trunk/ChangeLog → README} +0 -0
- data/data/reap/scaffold/Rakefile +146 -0
- data/data/reap/scaffold/{subversion/trunk/TODO → Todo} +0 -0
- data/{doc/note → data/reap/scaffold}/setup.rb +11 -18
- data/{doc/note/aRakefile → dev/Rakefile} +0 -0
- data/{doc/note → dev}/composite_task.rb +0 -0
- data/{doc/note → dev}/compositepublisher.rb +0 -0
- data/{doc/note → dev}/ftptools.rb +0 -0
- data/{doc/note → dev}/license-each.rb +0 -0
- data/{doc/note → dev}/publisher.rb +0 -0
- data/{doc/note → dev}/rubyforgepublisher.rb +0 -0
- data/{doc/note → dev}/sshpublisher.rb +0 -0
- data/{doc/note → dev}/suby-cvs.rb +0 -0
- data/{doc/note → dev}/template.rb +0 -0
- data/lib/reap/bin/reap.rb +67 -84
- data/{doc/note/interface/interface.rb → lib/reap/lint.rb} +0 -0
- data/lib/reap/projectinfo.rb +28 -206
- data/lib/reap/readymade.rb +21 -0
- data/lib/reap/task.rb +118 -184
- data/lib/reap/task/announce.rb +93 -181
- data/lib/reap/task/fileperm.rb +16 -46
- data/lib/reap/task/info.rb +7 -33
- data/lib/reap/task/install.rb +17 -52
- data/{task → lib/reap/task}/noop.rb +9 -4
- data/lib/reap/task/package.rb +102 -348
- data/lib/reap/task/publish.rb +29 -155
- data/lib/reap/task/rdoc.rb +40 -92
- data/lib/reap/task/scaffold.rb +98 -41
- data/lib/reap/task/test.rb +52 -147
- data/lib/reap/task/testext.rb +110 -0
- data/lib/reap/task/webpublish.rb +43 -0
- data/lib/reap/tasks.rb +13 -0
- data/lib/reap/test.rb +138 -0
- data/setup.rb +272 -287
- data/test/tc_reap.rb +1 -1
- data/web/ProjectInfo +57 -0
- data/web/images/appleboy.jpg +0 -0
- data/web/images/grape.jpg +0 -0
- data/web/index.html +124 -0
- data/web/rdoc/classes/Object.html +121 -0
- data/web/rdoc/classes/ProjectInfo.html +207 -0
- data/web/rdoc/classes/ProjectInfo.src/M000094.html +18 -0
- data/web/rdoc/classes/ProjectInfo.src/M000095.html +24 -0
- data/web/rdoc/classes/ProjectInfo.src/M000096.html +22 -0
- data/web/rdoc/classes/ProjectInfo.src/M000097.html +21 -0
- data/web/rdoc/classes/ProjectInfo.src/M000098.html +18 -0
- data/web/rdoc/classes/Reap.html +248 -0
- data/web/rdoc/classes/Reap.src/M000023.html +16 -0
- data/web/rdoc/classes/Reap.src/M000024.html +21 -0
- data/web/rdoc/classes/Reap.src/M000025.html +16 -0
- data/web/rdoc/classes/Reap.src/M000026.html +21 -0
- data/web/rdoc/classes/Reap/Announce.html +262 -0
- data/web/rdoc/classes/Reap/Announce.src/M000030.html +18 -0
- data/web/rdoc/classes/Reap/Announce.src/M000031.html +114 -0
- data/web/rdoc/classes/Reap/Announce.src/M000032.html +46 -0
- data/web/rdoc/classes/Reap/Info.html +176 -0
- data/web/rdoc/classes/Reap/Info.src/M000033.html +18 -0
- data/web/rdoc/classes/Reap/Info.src/M000034.html +17 -0
- data/web/rdoc/classes/Reap/Info.src/M000035.html +18 -0
- data/web/rdoc/classes/Reap/Install.html +193 -0
- data/web/rdoc/classes/Reap/Install.src/M000036.html +18 -0
- data/web/rdoc/classes/Reap/Install.src/M000037.html +20 -0
- data/web/rdoc/classes/Reap/Install.src/M000038.html +26 -0
- data/web/rdoc/classes/Reap/Noop.html +192 -0
- data/web/rdoc/classes/Reap/Noop.src/M000027.html +18 -0
- data/web/rdoc/classes/Reap/Noop.src/M000028.html +17 -0
- data/web/rdoc/classes/Reap/Noop.src/M000029.html +18 -0
- data/web/rdoc/classes/Reap/Package.html +310 -0
- data/web/rdoc/classes/Reap/Package.src/M000055.html +18 -0
- data/web/rdoc/classes/Reap/Package.src/M000056.html +68 -0
- data/web/rdoc/classes/Reap/Package.src/M000057.html +84 -0
- data/web/rdoc/classes/Reap/Package.src/M000058.html +61 -0
- data/web/rdoc/classes/Reap/Perm.html +236 -0
- data/web/rdoc/classes/Reap/Perm.src/M000078.html +18 -0
- data/web/rdoc/classes/Reap/Perm.src/M000079.html +21 -0
- data/web/rdoc/classes/Reap/Perm.src/M000080.html +42 -0
- data/web/rdoc/classes/Reap/Perm.src/M000081.html +26 -0
- data/web/rdoc/classes/Reap/Perm.src/M000082.html +18 -0
- data/web/rdoc/classes/Reap/Publish.html +213 -0
- data/web/rdoc/classes/Reap/Publish.src/M000070.html +18 -0
- data/web/rdoc/classes/Reap/Publish.src/M000071.html +22 -0
- data/web/rdoc/classes/Reap/Publish.src/M000072.html +37 -0
- data/web/rdoc/classes/Reap/RDoc.html +218 -0
- data/web/rdoc/classes/Reap/RDoc.src/M000059.html +18 -0
- data/web/rdoc/classes/Reap/RDoc.src/M000060.html +24 -0
- data/web/rdoc/classes/Reap/RDoc.src/M000061.html +70 -0
- data/web/rdoc/classes/Reap/Task.html +396 -0
- data/web/rdoc/classes/Reap/Task.src/M000039.html +18 -0
- data/web/rdoc/classes/Reap/Task.src/M000040.html +16 -0
- data/web/rdoc/classes/Reap/Task.src/M000041.html +16 -0
- data/web/rdoc/classes/Reap/Task.src/M000042.html +16 -0
- data/web/rdoc/classes/Reap/Task.src/M000043.html +16 -0
- data/web/rdoc/classes/Reap/Task.src/M000044.html +22 -0
- data/web/rdoc/classes/Reap/Task.src/M000045.html +16 -0
- data/web/rdoc/classes/Reap/Task.src/M000046.html +16 -0
- data/web/rdoc/classes/Reap/Task.src/M000047.html +16 -0
- data/web/rdoc/classes/Reap/Task.src/M000048.html +16 -0
- data/web/rdoc/classes/Reap/Task.src/M000049.html +16 -0
- data/web/rdoc/classes/Reap/Task.src/M000050.html +27 -0
- data/web/rdoc/classes/Reap/Task.src/M000051.html +19 -0
- data/web/rdoc/classes/Reap/Task.src/M000052.html +18 -0
- data/web/rdoc/classes/Reap/Task.src/M000053.html +18 -0
- data/web/rdoc/classes/Reap/Task.src/M000054.html +19 -0
- data/web/rdoc/classes/Reap/Test.html +253 -0
- data/web/rdoc/classes/Reap/Test.src/M000062.html +18 -0
- data/web/rdoc/classes/Reap/Test.src/M000063.html +26 -0
- data/web/rdoc/classes/Reap/Test.src/M000064.html +77 -0
- data/web/rdoc/classes/Reap/Test.src/M000065.html +27 -0
- data/web/rdoc/classes/Reap/Test.src/M000066.html +50 -0
- data/web/rdoc/classes/Reap/Test/TestResults.html +205 -0
- data/web/rdoc/classes/Reap/Test/TestResults.src/M000067.html +21 -0
- data/web/rdoc/classes/Reap/Test/TestResults.src/M000068.html +21 -0
- data/web/rdoc/classes/Reap/Test/TestResults.src/M000069.html +23 -0
- data/web/rdoc/classes/Reap/TestExt.html +234 -0
- data/web/rdoc/classes/Reap/TestExt.src/M000073.html +18 -0
- data/web/rdoc/classes/Reap/TestExt.src/M000074.html +20 -0
- data/web/rdoc/classes/Reap/TestExt.src/M000075.html +49 -0
- data/web/rdoc/classes/Reap/TestExt.src/M000076.html +34 -0
- data/web/rdoc/classes/Reap/TestExt.src/M000077.html +27 -0
- data/web/rdoc/classes/Reap/WebPublish.html +213 -0
- data/web/rdoc/classes/Reap/WebPublish.src/M000083.html +18 -0
- data/web/rdoc/classes/Reap/WebPublish.src/M000084.html +21 -0
- data/web/rdoc/classes/Reap/WebPublish.src/M000085.html +32 -0
- data/web/rdoc/classes/ReapCommand.html +425 -0
- data/web/rdoc/classes/ReapCommand.src/M000001.html +16 -0
- data/web/rdoc/classes/ReapCommand.src/M000003.html +16 -0
- data/web/rdoc/classes/ReapCommand.src/M000005.html +16 -0
- data/web/rdoc/classes/ReapCommand.src/M000007.html +16 -0
- data/web/rdoc/classes/ReapCommand.src/M000009.html +16 -0
- data/web/rdoc/classes/ReapCommand.src/M000011.html +16 -0
- data/web/rdoc/classes/ReapCommand.src/M000013.html +18 -0
- data/web/rdoc/classes/ReapCommand.src/M000014.html +19 -0
- data/web/rdoc/classes/ReapCommand.src/M000015.html +19 -0
- data/web/rdoc/classes/ReapCommand.src/M000016.html +24 -0
- data/web/rdoc/classes/ReapCommand.src/M000018.html +29 -0
- data/web/rdoc/classes/Scaffold.html +211 -0
- data/web/rdoc/classes/Scaffold.src/M000086.html +16 -0
- data/web/rdoc/classes/Scaffold.src/M000087.html +28 -0
- data/web/rdoc/classes/Scaffold.src/M000088.html +32 -0
- data/web/rdoc/classes/Scaffold.src/M000089.html +18 -0
- data/web/rdoc/classes/UnitTestKernel.html +176 -0
- data/web/rdoc/classes/UnitTestKernel.src/M000019.html +18 -0
- data/web/rdoc/classes/UnitTestKernel.src/M000020.html +18 -0
- data/web/rdoc/classes/UnitTestKernel.src/M000021.html +22 -0
- data/web/rdoc/classes/UnitTestKernel.src/M000022.html +22 -0
- data/web/rdoc/classes/UnitTesting.html +165 -0
- data/web/rdoc/classes/UnitTesting.src/M000090.html +34 -0
- data/web/rdoc/classes/UnitTesting.src/M000091.html +18 -0
- data/web/rdoc/classes/UnitTesting/Failure.html +156 -0
- data/web/rdoc/classes/UnitTesting/Failure.src/M000092.html +18 -0
- data/web/rdoc/classes/UnitTesting/Failure.src/M000093.html +21 -0
- data/web/rdoc/created.rid +1 -0
- data/web/rdoc/files/ANN.html +107 -0
- data/web/rdoc/files/COPYING.html +119 -0
- data/web/rdoc/files/ChangeLog.html +144 -0
- data/web/rdoc/files/ProjectInfo.html +190 -0
- data/web/rdoc/files/README.html +274 -0
- data/web/rdoc/files/Rakefile.html +101 -0
- data/web/rdoc/files/lib/reap/bin/reap_rb.html +129 -0
- data/web/rdoc/files/lib/reap/lint_rb.html +101 -0
- data/web/rdoc/files/lib/reap/projectinfo_rb.html +110 -0
- data/web/rdoc/files/lib/reap/readymade_rb.html +123 -0
- data/web/rdoc/files/lib/reap/task/announce_rb.html +114 -0
- data/web/rdoc/files/lib/reap/task/fileperm_rb.html +108 -0
- data/web/rdoc/files/lib/reap/task/info_rb.html +108 -0
- data/web/rdoc/files/lib/reap/task/install_rb.html +108 -0
- data/web/rdoc/files/lib/reap/task/noop_rb.html +108 -0
- data/web/rdoc/files/lib/reap/task/package_rb.html +109 -0
- data/web/rdoc/files/lib/reap/task/publish_rb.html +108 -0
- data/web/rdoc/files/lib/reap/task/rdoc_rb.html +108 -0
- data/web/rdoc/files/lib/reap/task/scaffold_rb.html +107 -0
- data/web/rdoc/files/lib/reap/task/test_rb.html +110 -0
- data/web/rdoc/files/lib/reap/task/testext_rb.html +109 -0
- data/web/rdoc/files/lib/reap/task/webpublish_rb.html +108 -0
- data/web/rdoc/files/lib/reap/task_rb.html +120 -0
- data/web/rdoc/files/lib/reap/tasks_rb.html +116 -0
- data/web/rdoc/files/lib/reap/test_rb.html +109 -0
- data/web/rdoc/fr_class_index.html +47 -0
- data/web/rdoc/fr_file_index.html +51 -0
- data/web/rdoc/fr_method_index.html +124 -0
- data/web/rdoc/index.html +24 -0
- data/web/rdoc/rdoc-style.css +208 -0
- metadata +257 -138
- data/bin/rubytest +0 -5
- data/data/reap/scaffold/standard/COPYING +0 -403
- data/data/reap/scaffold/standard/INSTALL +0 -14
- data/data/reap/scaffold/standard/README +0 -3
- data/data/reap/scaffold/standard/Rakefile +0 -10
- data/data/reap/scaffold/standard/setup.rb +0 -1568
- data/data/reap/scaffold/subversion/trunk/COPYING +0 -403
- data/data/reap/scaffold/subversion/trunk/INSTALL +0 -14
- data/data/reap/scaffold/subversion/trunk/ProjectInfo +0 -78
- data/data/reap/scaffold/subversion/trunk/README +0 -3
- data/data/reap/scaffold/subversion/trunk/Rakefile +0 -10
- data/data/reap/scaffold/subversion/trunk/setup.rb +0 -1568
- data/data/reap/setup.rb +0 -1568
- data/doc/COPYING +0 -403
- data/doc/ChangeLog +0 -18
- data/doc/LATEST +0 -29
- data/doc/README +0 -182
- data/doc/doap.xml +0 -27
- data/doc/note/ProjectInfo.rb +0 -88
- data/doc/note/Rakefile.0 +0 -118
- data/doc/note/Rakefile.htm +0 -69
- data/doc/note/application.rb +0 -124
- data/doc/note/interface/rubyforge.rb +0 -247
- data/doc/note/intro.txt +0 -42
- data/doc/note/package.rb +0 -629
- data/doc/note/package.rb.0 +0 -394
- data/doc/note/scaffold.rb +0 -123
- data/lib/reap/app.rb +0 -74
- data/lib/reap/bin/rubylint.rb +0 -1
- data/lib/reap/bin/rubytest.rb +0 -45
- data/lib/reap/rake.rb +0 -12
- data/lib/reap/rakeadapter.rb +0 -50
- data/lib/reap/reap.rb +0 -32
- data/lib/reap/task/custom.rb +0 -12
- data/lib/reap/task/doap.rb +0 -85
- data/lib/reap/task/extest.rb +0 -161
- data/lib/reap/task/manifest.rb +0 -70
- data/lib/reap/task/release.rb +0 -512
- data/lib/reap/task/template.rb +0 -46
- data/lib/reap/vendor/http-access2.rb +0 -1590
- data/lib/reap/vendor/http-access2/cookie.rb +0 -538
- data/lib/reap/vendor/http-access2/http.rb +0 -542
data/lib/reap/tasks.rb
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
|
2
|
+
require 'reap/task/fileperm'
|
3
|
+
require 'reap/task/test'
|
4
|
+
require 'reap/task/testext'
|
5
|
+
require 'reap/task/rdoc'
|
6
|
+
require 'reap/task/announce'
|
7
|
+
require 'reap/task/package'
|
8
|
+
require 'reap/task/publish'
|
9
|
+
require 'reap/task/info'
|
10
|
+
require 'reap/task/install'
|
11
|
+
#require 'reap/task/noop'
|
12
|
+
#require 'reap/webpublish'
|
13
|
+
|
data/lib/reap/test.rb
ADDED
@@ -0,0 +1,138 @@
|
|
1
|
+
require 'facet/kernel/sym_esc'
|
2
|
+
require 'yaml'
|
3
|
+
|
4
|
+
$test_mode = false
|
5
|
+
$test_failures = []
|
6
|
+
|
7
|
+
|
8
|
+
module UnitTestKernel
|
9
|
+
|
10
|
+
def assert_on!
|
11
|
+
$test_mode = true
|
12
|
+
end
|
13
|
+
|
14
|
+
def assert_off!
|
15
|
+
$test_mode = false
|
16
|
+
end
|
17
|
+
|
18
|
+
def assert!(&blk)
|
19
|
+
old = $test_mode
|
20
|
+
$test_mode = true
|
21
|
+
r = blk.call
|
22
|
+
$test_mode = old
|
23
|
+
return r
|
24
|
+
end
|
25
|
+
|
26
|
+
def no_assertion!(&blk)
|
27
|
+
old = $test_mode
|
28
|
+
$test_mode = false
|
29
|
+
r = blk.call
|
30
|
+
$test_mode = old
|
31
|
+
return r
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
35
|
+
|
36
|
+
class Object
|
37
|
+
include UnitTestKernel
|
38
|
+
end
|
39
|
+
|
40
|
+
|
41
|
+
module UnitTesting
|
42
|
+
|
43
|
+
class Failure
|
44
|
+
|
45
|
+
def to_yaml_properties
|
46
|
+
[ '@self', '@method', '@args', '@caller' ]
|
47
|
+
end
|
48
|
+
|
49
|
+
def initialize( slf, meth, args, callr )
|
50
|
+
@self = slf
|
51
|
+
@method = meth
|
52
|
+
@args = args
|
53
|
+
@caller = callr
|
54
|
+
end
|
55
|
+
|
56
|
+
end
|
57
|
+
|
58
|
+
|
59
|
+
TRANSPARENT_ASSERTIONS = %w{
|
60
|
+
== === eql? equal? kind_of? include?
|
61
|
+
member? empty? nil? has_key? key? respond_to?
|
62
|
+
between?
|
63
|
+
}
|
64
|
+
|
65
|
+
def self.advise_assertions
|
66
|
+
|
67
|
+
ObjectSpace.each_object(Module) do |m|
|
68
|
+
|
69
|
+
TRANSPARENT_ASSERTIONS.each do |meth|
|
70
|
+
|
71
|
+
nmeth = "assert_#{sym_esc(meth)}"
|
72
|
+
|
73
|
+
if m.method_defined?(meth)
|
74
|
+
|
75
|
+
m.class_eval <<-HERE
|
76
|
+
alias :#{nmeth} :#{meth}
|
77
|
+
def #{meth}(*args)
|
78
|
+
if $test_mode
|
79
|
+
r = nil
|
80
|
+
no_assertion! {
|
81
|
+
r = #{nmeth}(*args)
|
82
|
+
unless r
|
83
|
+
$test_failures << Failure.new( self, :"#{meth}", args, caller[2..-1] )
|
84
|
+
end
|
85
|
+
}
|
86
|
+
return r
|
87
|
+
else
|
88
|
+
return #{nmeth}(*args)
|
89
|
+
end
|
90
|
+
end
|
91
|
+
HERE
|
92
|
+
|
93
|
+
end #if
|
94
|
+
|
95
|
+
end #do
|
96
|
+
|
97
|
+
end #do
|
98
|
+
|
99
|
+
end #def
|
100
|
+
|
101
|
+
def self.report
|
102
|
+
y $test_failures
|
103
|
+
end
|
104
|
+
|
105
|
+
end
|
106
|
+
|
107
|
+
class Object
|
108
|
+
include UnitTestKernel
|
109
|
+
end
|
110
|
+
|
111
|
+
UnitTesting.advise_assertions
|
112
|
+
|
113
|
+
|
114
|
+
=begin testing
|
115
|
+
|
116
|
+
class X
|
117
|
+
def a
|
118
|
+
1
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
class TestX < X
|
123
|
+
|
124
|
+
def test_a
|
125
|
+
assert! {
|
126
|
+
a == 1
|
127
|
+
a == 2
|
128
|
+
}
|
129
|
+
end
|
130
|
+
|
131
|
+
end
|
132
|
+
|
133
|
+
x = TestX.new
|
134
|
+
x.test_a
|
135
|
+
|
136
|
+
UnitTesting.report
|
137
|
+
|
138
|
+
=end
|
data/setup.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
1
3
|
#
|
2
4
|
# setup.rb
|
3
5
|
#
|
@@ -8,50 +10,21 @@
|
|
8
10
|
# the GNU LGPL, Lesser General Public License version 2.1.
|
9
11
|
#
|
10
12
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
#############################
|
16
|
-
|
17
|
-
# CHANGE No longer need to support 1.4.6 or 1.6 versions of Ruby.
|
18
|
-
|
19
|
-
# unless Enumerable.method_defined?(:map) # Ruby 1.4.6
|
20
|
-
# module Enumerable
|
21
|
-
# alias map collect
|
22
|
-
# end
|
23
|
-
# end
|
24
|
-
|
25
|
-
# unless File.respond_to?(:read) # Ruby 1.6
|
26
|
-
# def File.read(fname)
|
27
|
-
# open(fname) {|f|
|
28
|
-
# return f.read
|
29
|
-
# }
|
30
|
-
# end
|
31
|
-
# end
|
32
|
-
|
33
|
-
# This is hack!
|
34
|
-
# This is needed to install within an abitrary root dir.
|
35
|
-
# B/c setup.rb has become spegetti code, I was forced to do this hack.
|
36
|
-
# Setup.rb shuld be re-writ. I would use package.rb instead but
|
37
|
-
# it lacks hooks and extension compilation. But we'll keep
|
38
|
-
# an eye on that one for the future. -trans.
|
39
|
-
|
40
|
-
$setup_install_root = nil
|
41
|
-
ARGV.each{ |a|
|
42
|
-
if md = /--root=(.*)/.match( a )
|
43
|
-
$setup_install_root = md[1]
|
44
|
-
end
|
45
|
-
}
|
46
|
-
if $setup_install_root
|
47
|
-
ARGV.delete("--root=#{$setup_install_root}")
|
48
|
-
$setup_install_root = File.expand_path($setup_install_root)
|
49
|
-
puts "(root=#{$setup_install_root})"
|
13
|
+
unless Enumerable.method_defined?(:map) # Ruby 1.4.6
|
14
|
+
module Enumerable
|
15
|
+
alias map collect
|
16
|
+
end
|
50
17
|
end
|
51
18
|
|
52
|
-
#
|
19
|
+
unless File.respond_to?(:read) # Ruby 1.6
|
20
|
+
def File.read(fname)
|
21
|
+
open(fname) {|f|
|
22
|
+
return f.read
|
23
|
+
}
|
24
|
+
end
|
25
|
+
end
|
53
26
|
|
54
|
-
unless Errno.const_defined?(:ENOTEMPTY)
|
27
|
+
unless Errno.const_defined?(:ENOTEMPTY) # Windows?
|
55
28
|
module Errno
|
56
29
|
class ENOTEMPTY
|
57
30
|
# We do not raise this exception, implementation is not needed.
|
@@ -84,16 +57,25 @@ class ConfigTable
|
|
84
57
|
@config_opt = nil
|
85
58
|
@verbose = true
|
86
59
|
@no_harm = false
|
60
|
+
@libsrc_pattern = '*.rb'
|
87
61
|
end
|
88
62
|
|
89
63
|
attr_accessor :install_prefix
|
90
64
|
attr_accessor :config_opt
|
91
65
|
|
92
|
-
|
93
|
-
|
66
|
+
attr_writer :verbose
|
67
|
+
|
68
|
+
def verbose?
|
69
|
+
@verbose
|
70
|
+
end
|
71
|
+
|
72
|
+
attr_writer :no_harm
|
73
|
+
|
74
|
+
def no_harm?
|
75
|
+
@no_harm
|
76
|
+
end
|
94
77
|
|
95
|
-
|
96
|
-
def no_harm?() @no_harm end
|
78
|
+
attr_accessor :libsrc_pattern
|
97
79
|
|
98
80
|
def [](key)
|
99
81
|
lookup(key).resolve(self)
|
@@ -137,7 +119,9 @@ class ConfigTable
|
|
137
119
|
end
|
138
120
|
end
|
139
121
|
|
140
|
-
def savefile
|
122
|
+
def savefile
|
123
|
+
'.config'
|
124
|
+
end
|
141
125
|
|
142
126
|
def load_savefile
|
143
127
|
begin
|
@@ -160,126 +144,124 @@ class ConfigTable
|
|
160
144
|
end
|
161
145
|
|
162
146
|
def load_standard_entries
|
163
|
-
|
164
|
-
standard_entries.each do |ent|
|
147
|
+
standard_entries(@rbconfig).each do |ent|
|
165
148
|
add ent
|
166
149
|
end
|
167
150
|
end
|
168
151
|
|
169
|
-
def standard_entries
|
170
|
-
|
152
|
+
def standard_entries(rbconfig)
|
153
|
+
c = rbconfig
|
171
154
|
|
172
|
-
rubypath =
|
155
|
+
rubypath = c['bindir'] + '/' + c['ruby_install_name']
|
173
156
|
|
174
|
-
major =
|
175
|
-
minor =
|
176
|
-
teeny =
|
157
|
+
major = c['MAJOR'].to_i
|
158
|
+
minor = c['MINOR'].to_i
|
159
|
+
teeny = c['TEENY'].to_i
|
177
160
|
version = "#{major}.#{minor}"
|
178
161
|
|
179
|
-
#
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
# ((minor >= 5) or
|
185
|
-
# ((minor == 4) and (teeny >= 4)))))
|
162
|
+
# ruby ver. >= 1.4.4?
|
163
|
+
newpath_p = ((major >= 2) or
|
164
|
+
((major == 1) and
|
165
|
+
((minor >= 5) or
|
166
|
+
((minor == 4) and (teeny >= 4)))))
|
186
167
|
|
187
|
-
|
168
|
+
if c['rubylibdir']
|
188
169
|
# V > 1.6.3
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
#
|
208
|
-
#
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
# siteruby = c['sitedir']
|
213
|
-
# siterubyver = "$siteruby/#{version}"
|
214
|
-
# siterubyverarch = "$siterubyver/#{c['arch']}"
|
215
|
-
# else
|
216
|
-
# # V < 1.4.4
|
217
|
-
# libruby = "#{c['prefix']}/lib/ruby"
|
218
|
-
# librubyver = "#{c['prefix']}/lib/ruby/#{version}"
|
219
|
-
# librubyverarch = "#{c['prefix']}/lib/ruby/#{version}/#{c['arch']}"
|
220
|
-
# siteruby = "#{c['prefix']}/lib/ruby/#{version}/site_ruby"
|
221
|
-
# siterubyver = siteruby
|
222
|
-
# siterubyverarch = "$siterubyver/#{c['arch']}"
|
223
|
-
# end
|
224
|
-
|
170
|
+
libruby = "#{c['prefix']}/lib/ruby"
|
171
|
+
librubyver = c['rubylibdir']
|
172
|
+
librubyverarch = c['archdir']
|
173
|
+
siteruby = c['sitedir']
|
174
|
+
siterubyver = c['sitelibdir']
|
175
|
+
siterubyverarch = c['sitearchdir']
|
176
|
+
elsif newpath_p
|
177
|
+
# 1.4.4 <= V <= 1.6.3
|
178
|
+
libruby = "#{c['prefix']}/lib/ruby"
|
179
|
+
librubyver = "#{c['prefix']}/lib/ruby/#{version}"
|
180
|
+
librubyverarch = "#{c['prefix']}/lib/ruby/#{version}/#{c['arch']}"
|
181
|
+
siteruby = c['sitedir']
|
182
|
+
siterubyver = "$siteruby/#{version}"
|
183
|
+
siterubyverarch = "$siterubyver/#{c['arch']}"
|
184
|
+
else
|
185
|
+
# V < 1.4.4
|
186
|
+
libruby = "#{c['prefix']}/lib/ruby"
|
187
|
+
librubyver = "#{c['prefix']}/lib/ruby/#{version}"
|
188
|
+
librubyverarch = "#{c['prefix']}/lib/ruby/#{version}/#{c['arch']}"
|
189
|
+
siteruby = "#{c['prefix']}/lib/ruby/#{version}/site_ruby"
|
190
|
+
siterubyver = siteruby
|
191
|
+
siterubyverarch = "$siterubyver/#{c['arch']}"
|
192
|
+
end
|
225
193
|
parameterize = lambda {|path|
|
226
|
-
path.sub(/\A#{Regexp.quote(
|
194
|
+
path.sub(/\A#{Regexp.quote(c['prefix'])}/, '$prefix')
|
227
195
|
}
|
228
196
|
|
229
|
-
if arg =
|
197
|
+
if arg = c['configure_args'].split.detect {|arg| /--with-make-prog=/ =~ arg }
|
230
198
|
makeprog = arg.sub(/'/, '').split(/=/, 2)[1]
|
231
199
|
else
|
232
200
|
makeprog = 'make'
|
233
201
|
end
|
234
202
|
|
235
|
-
installdir_lambda = lambda {|val, table|
|
236
|
-
case val
|
237
|
-
when 'std'
|
238
|
-
table['rbdir'] = '$librubyver'
|
239
|
-
table['sodir'] = '$librubyverarch'
|
240
|
-
when 'site'
|
241
|
-
table['rbdir'] = '$siterubyver'
|
242
|
-
table['sodir'] = '$siterubyverarch'
|
243
|
-
when 'home'
|
244
|
-
setup_rb_error '$HOME was not set' unless ENV['HOME']
|
245
|
-
table['prefix'] = ENV['HOME']
|
246
|
-
table['rbdir'] = '$libdir/ruby'
|
247
|
-
table['sodir'] = '$libdir/ruby'
|
248
|
-
end
|
249
|
-
}
|
250
|
-
|
251
203
|
[
|
252
|
-
ExecItem.new('installdirs', 'std/site/home',
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
PathItem.new('
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
204
|
+
ExecItem.new('installdirs', 'std/site/home',
|
205
|
+
'std: install under libruby; site: install under site_ruby; home: install under $HOME')\
|
206
|
+
{|val, table|
|
207
|
+
case val
|
208
|
+
when 'std'
|
209
|
+
table['rbdir'] = '$librubyver'
|
210
|
+
table['sodir'] = '$librubyverarch'
|
211
|
+
when 'site'
|
212
|
+
table['rbdir'] = '$siterubyver'
|
213
|
+
table['sodir'] = '$siterubyverarch'
|
214
|
+
when 'home'
|
215
|
+
setup_rb_error '$HOME was not set' unless ENV['HOME']
|
216
|
+
table['prefix'] = ENV['HOME']
|
217
|
+
table['rbdir'] = '$libdir/ruby'
|
218
|
+
table['sodir'] = '$libdir/ruby'
|
219
|
+
end
|
220
|
+
},
|
221
|
+
PathItem.new('prefix', 'path', c['prefix'],
|
222
|
+
'path prefix of target environment'),
|
223
|
+
PathItem.new('bindir', 'path', parameterize.call(c['bindir']),
|
224
|
+
'the directory for commands'),
|
225
|
+
PathItem.new('libdir', 'path', parameterize.call(c['libdir']),
|
226
|
+
'the directory for libraries'),
|
227
|
+
PathItem.new('datadir', 'path', parameterize.call(c['datadir']),
|
228
|
+
'the directory for shared data'),
|
229
|
+
PathItem.new('mandir', 'path', parameterize.call(c['mandir']),
|
230
|
+
'the directory for man pages'),
|
231
|
+
PathItem.new('sysconfdir', 'path', parameterize.call(c['sysconfdir']),
|
232
|
+
'the directory for system configuration files'),
|
233
|
+
PathItem.new('localstatedir', 'path', parameterize.call(c['localstatedir']),
|
234
|
+
'the directory for local state data'),
|
235
|
+
PathItem.new('libruby', 'path', libruby,
|
236
|
+
'the directory for ruby libraries'),
|
237
|
+
PathItem.new('librubyver', 'path', librubyver,
|
238
|
+
'the directory for standard ruby libraries'),
|
239
|
+
PathItem.new('librubyverarch', 'path', librubyverarch,
|
240
|
+
'the directory for standard ruby extensions'),
|
241
|
+
PathItem.new('siteruby', 'path', siteruby,
|
242
|
+
'the directory for version-independent aux ruby libraries'),
|
243
|
+
PathItem.new('siterubyver', 'path', siterubyver,
|
244
|
+
'the directory for aux ruby libraries'),
|
245
|
+
PathItem.new('siterubyverarch', 'path', siterubyverarch,
|
246
|
+
'the directory for aux ruby binaries'),
|
247
|
+
PathItem.new('rbdir', 'path', '$siterubyver',
|
248
|
+
'the directory for ruby scripts'),
|
249
|
+
PathItem.new('sodir', 'path', '$siterubyverarch',
|
250
|
+
'the directory for ruby extentions'),
|
251
|
+
PathItem.new('rubypath', 'path', rubypath,
|
252
|
+
'the path to set to #! line'),
|
253
|
+
ProgramItem.new('rubyprog', 'name', rubypath,
|
254
|
+
'the ruby program using for installation'),
|
255
|
+
ProgramItem.new('makeprog', 'name', makeprog,
|
256
|
+
'the make program to compile ruby extentions'),
|
257
|
+
SelectItem.new('shebang', 'all/ruby/never', 'ruby',
|
258
|
+
'shebang line (#!) editing mode'),
|
259
|
+
BoolItem.new('without-ext', 'yes/no', 'no',
|
260
|
+
'does not compile/install ruby extentions')
|
274
261
|
]
|
275
262
|
end
|
276
263
|
private :standard_entries
|
277
264
|
|
278
|
-
def paramize( path )
|
279
|
-
path.sub(/\A#{Regexp.quote(@rbconfig['prefix'])}/, '$prefix')
|
280
|
-
end
|
281
|
-
private :paramize
|
282
|
-
|
283
265
|
def load_multipackage_entries
|
284
266
|
multipackage_entries().each do |ent|
|
285
267
|
add ent
|
@@ -288,8 +270,10 @@ class ConfigTable
|
|
288
270
|
|
289
271
|
def multipackage_entries
|
290
272
|
[
|
291
|
-
PackageSelectionItem.new('with',
|
292
|
-
|
273
|
+
PackageSelectionItem.new('with', 'name,name...', '', 'ALL',
|
274
|
+
'package names that you want to install'),
|
275
|
+
PackageSelectionItem.new('without', 'name,name...', '', 'NONE',
|
276
|
+
'package names that you do not want to install')
|
293
277
|
]
|
294
278
|
end
|
295
279
|
private :multipackage_entries
|
@@ -354,8 +338,13 @@ class ConfigTable
|
|
354
338
|
"--#{@name}=#{@template}"
|
355
339
|
end
|
356
340
|
|
357
|
-
def value?
|
358
|
-
|
341
|
+
def value?
|
342
|
+
true
|
343
|
+
end
|
344
|
+
|
345
|
+
def value
|
346
|
+
@value
|
347
|
+
end
|
359
348
|
|
360
349
|
def resolve(table)
|
361
350
|
@value.gsub(%r<\$([^/]+)>) { table[$1] }
|
@@ -374,7 +363,9 @@ class ConfigTable
|
|
374
363
|
end
|
375
364
|
|
376
365
|
class BoolItem < Item
|
377
|
-
def config_type
|
366
|
+
def config_type
|
367
|
+
'bool'
|
368
|
+
end
|
378
369
|
|
379
370
|
def help_opt
|
380
371
|
"--#{@name}"
|
@@ -384,19 +375,20 @@ class ConfigTable
|
|
384
375
|
|
385
376
|
def check(val)
|
386
377
|
return 'yes' unless val
|
387
|
-
|
388
|
-
when /\Ay(es)?\z/i, /\At(rue)?\z/i then 'yes'
|
389
|
-
when /\An(o)?\z/i, /\Af(alse)\z/i then 'no'
|
390
|
-
else
|
378
|
+
unless /\A(y(es)?|n(o)?|t(rue)?|f(alse))\z/i =~ val
|
391
379
|
setup_rb_error "config: --#{@name} accepts only yes/no for argument"
|
392
380
|
end
|
381
|
+
(/\Ay(es)?|\At(rue)/i =~ value) ? 'yes' : 'no'
|
393
382
|
end
|
394
383
|
end
|
395
384
|
|
396
385
|
class PathItem < Item
|
397
|
-
def config_type
|
386
|
+
def config_type
|
387
|
+
'path'
|
388
|
+
end
|
398
389
|
|
399
390
|
private
|
391
|
+
|
400
392
|
def check(path)
|
401
393
|
setup_rb_error "config: --#{@name} requires argument" unless path
|
402
394
|
path[0,1] == '$' ? path : File.expand_path(path)
|
@@ -404,7 +396,9 @@ class ConfigTable
|
|
404
396
|
end
|
405
397
|
|
406
398
|
class ProgramItem < Item
|
407
|
-
def config_type
|
399
|
+
def config_type
|
400
|
+
'program'
|
401
|
+
end
|
408
402
|
end
|
409
403
|
|
410
404
|
class SelectItem < Item
|
@@ -413,9 +407,12 @@ class ConfigTable
|
|
413
407
|
@ok = selection.split('/')
|
414
408
|
end
|
415
409
|
|
416
|
-
def config_type
|
410
|
+
def config_type
|
411
|
+
'select'
|
412
|
+
end
|
417
413
|
|
418
414
|
private
|
415
|
+
|
419
416
|
def check(val)
|
420
417
|
unless @ok.include?(val.strip)
|
421
418
|
setup_rb_error "config: use --#{@name}=#{@template} (#{val})"
|
@@ -477,7 +474,7 @@ class ConfigTable
|
|
477
474
|
end
|
478
475
|
|
479
476
|
class MetaConfigEnvironment
|
480
|
-
def
|
477
|
+
def intiailize(config, installer)
|
481
478
|
@config = config
|
482
479
|
@installer = installer
|
483
480
|
end
|
@@ -542,9 +539,7 @@ end # class ConfigTable
|
|
542
539
|
module FileOperations
|
543
540
|
|
544
541
|
def mkdir_p(dirname, prefix = nil)
|
545
|
-
dirname =
|
546
|
-
dirname = File.join( $setup_install_root, dirname ) if $setup_install_root
|
547
|
-
|
542
|
+
dirname = prefix + File.expand_path(dirname) if prefix
|
548
543
|
$stderr.puts "mkdir -p #{dirname}" if verbose?
|
549
544
|
return if no_harm?
|
550
545
|
|
@@ -628,15 +623,11 @@ module FileOperations
|
|
628
623
|
end
|
629
624
|
|
630
625
|
def install(from, dest, mode, prefix = nil)
|
631
|
-
|
632
|
-
realdest = prefix ? File.join(prefix, File.expand_path(dest)) : dest
|
633
|
-
realdest = File.join($setup_install_root, File.expand_path(realdest)) if $setup_install_root
|
634
|
-
|
635
626
|
$stderr.puts "install #{from} #{dest}" if verbose?
|
636
627
|
return if no_harm?
|
637
628
|
|
629
|
+
realdest = prefix ? prefix + File.expand_path(dest) : dest
|
638
630
|
realdest = File.join(realdest, File.basename(from)) if File.dir?(realdest)
|
639
|
-
|
640
631
|
str = File.binread(from)
|
641
632
|
if diff?(str, realdest)
|
642
633
|
verbose_off {
|
@@ -647,10 +638,6 @@ module FileOperations
|
|
647
638
|
}
|
648
639
|
File.chmod mode, realdest
|
649
640
|
|
650
|
-
# Do not make InstalledFiles entry if to alternate root.
|
651
|
-
# This prevents problem with root permissions on this file.
|
652
|
-
return true unless $setup_install_root
|
653
|
-
|
654
641
|
File.open("#{objdir_root()}/InstalledFiles", 'a') {|f|
|
655
642
|
if prefix
|
656
643
|
f.puts realdest.sub(prefix, '')
|
@@ -675,7 +662,7 @@ module FileOperations
|
|
675
662
|
def ruby(*args)
|
676
663
|
command config('rubyprog'), *args
|
677
664
|
end
|
678
|
-
|
665
|
+
|
679
666
|
def make(task = nil)
|
680
667
|
command(*[config('makeprog'), task].compact)
|
681
668
|
end
|
@@ -715,14 +702,33 @@ module HookScriptAPI
|
|
715
702
|
@config[key] = val
|
716
703
|
end
|
717
704
|
|
705
|
+
#
|
718
706
|
# srcdir/objdir (works only in the package directory)
|
707
|
+
#
|
719
708
|
|
720
|
-
def curr_srcdir
|
721
|
-
|
722
|
-
|
723
|
-
|
724
|
-
def
|
725
|
-
|
709
|
+
def curr_srcdir
|
710
|
+
"#{srcdir_root()}/#{relpath()}"
|
711
|
+
end
|
712
|
+
|
713
|
+
def curr_objdir
|
714
|
+
"#{objdir_root()}/#{relpath()}"
|
715
|
+
end
|
716
|
+
|
717
|
+
def srcfile(path)
|
718
|
+
"#{curr_srcdir()}/#{path}"
|
719
|
+
end
|
720
|
+
|
721
|
+
def srcexist?(path)
|
722
|
+
File.exist?(srcfile(path))
|
723
|
+
end
|
724
|
+
|
725
|
+
def srcdirectory?(path)
|
726
|
+
File.dir?(srcfile(path))
|
727
|
+
end
|
728
|
+
|
729
|
+
def srcfile?(path)
|
730
|
+
File.file?(srcfile(path))
|
731
|
+
end
|
726
732
|
|
727
733
|
def srcentries(path = '.')
|
728
734
|
Dir.open("#{curr_srcdir()}/#{path}") {|d|
|
@@ -747,7 +753,7 @@ end
|
|
747
753
|
|
748
754
|
class ToplevelInstaller
|
749
755
|
|
750
|
-
Version = '3.4.
|
756
|
+
Version = '3.4.0'
|
751
757
|
Copyright = 'Copyright (c) 2000-2005 Minero Aoki'
|
752
758
|
|
753
759
|
TASKS = [
|
@@ -761,8 +767,8 @@ class ToplevelInstaller
|
|
761
767
|
[ 'distclean',"does `make distclean' for each extention" ]
|
762
768
|
]
|
763
769
|
|
764
|
-
def
|
765
|
-
config = ConfigTable.new(load_rbconfig)
|
770
|
+
def ToplevelInstaller.invoke
|
771
|
+
config = ConfigTable.new(load_rbconfig())
|
766
772
|
config.load_standard_entries
|
767
773
|
config.load_multipackage_entries if multipackage?
|
768
774
|
config.fixup
|
@@ -770,11 +776,11 @@ class ToplevelInstaller
|
|
770
776
|
klass.new(File.dirname($0), config).invoke
|
771
777
|
end
|
772
778
|
|
773
|
-
def
|
779
|
+
def ToplevelInstaller.multipackage?
|
774
780
|
File.dir?(File.dirname($0) + '/packages')
|
775
781
|
end
|
776
782
|
|
777
|
-
def
|
783
|
+
def ToplevelInstaller.load_rbconfig
|
778
784
|
if arg = ARGV.detect {|arg| /\A--rbconfig=/ =~ arg }
|
779
785
|
ARGV.delete(arg)
|
780
786
|
load File.expand_path(arg.split(/=/, 2)[1])
|
@@ -785,7 +791,6 @@ class ToplevelInstaller
|
|
785
791
|
::Config::CONFIG
|
786
792
|
end
|
787
793
|
|
788
|
-
|
789
794
|
def initialize(ardir_root, config)
|
790
795
|
@ardir = File.expand_path(ardir_root)
|
791
796
|
@config = config
|
@@ -824,7 +829,7 @@ class ToplevelInstaller
|
|
824
829
|
__send__ "exec_#{task}"
|
825
830
|
end
|
826
831
|
end
|
827
|
-
|
832
|
+
|
828
833
|
def run_metaconfigs
|
829
834
|
@config.load_script "#{@ardir}/metaconfig"
|
830
835
|
end
|
@@ -837,9 +842,17 @@ class ToplevelInstaller
|
|
837
842
|
# Hook Script API bases
|
838
843
|
#
|
839
844
|
|
840
|
-
def srcdir_root
|
841
|
-
|
842
|
-
|
845
|
+
def srcdir_root
|
846
|
+
@ardir
|
847
|
+
end
|
848
|
+
|
849
|
+
def objdir_root
|
850
|
+
'.'
|
851
|
+
end
|
852
|
+
|
853
|
+
def relpath
|
854
|
+
'.'
|
855
|
+
end
|
843
856
|
|
844
857
|
#
|
845
858
|
# Option Parsing
|
@@ -881,7 +894,6 @@ class ToplevelInstaller
|
|
881
894
|
|
882
895
|
def parsearg_no_options
|
883
896
|
unless ARGV.empty?
|
884
|
-
task = caller(0).first.slice(%r<`parsearg_(\w+)'>, 1)
|
885
897
|
setup_rb_error "#{task}: unknown options: #{ARGV.join(' ')}"
|
886
898
|
end
|
887
899
|
end
|
@@ -969,7 +981,6 @@ class ToplevelInstaller
|
|
969
981
|
out.puts
|
970
982
|
out.puts 'Options for INSTALL:'
|
971
983
|
out.printf fmt, '--no-harm', 'only display what to do if given', 'off'
|
972
|
-
out.printf fmt, '--root=path', 'install root directory (effects all paths)', '/'
|
973
984
|
out.printf fmt, '--prefix=path', 'install path prefix', ''
|
974
985
|
out.puts
|
975
986
|
end
|
@@ -1164,15 +1175,21 @@ class Installer
|
|
1164
1175
|
"#<#{self.class} #{File.basename(@srcdir)}>"
|
1165
1176
|
end
|
1166
1177
|
|
1167
|
-
def noop(rel) ; end
|
1168
|
-
|
1169
1178
|
#
|
1170
1179
|
# Hook Script API base methods
|
1171
1180
|
#
|
1172
1181
|
|
1173
|
-
def srcdir_root
|
1174
|
-
|
1175
|
-
|
1182
|
+
def srcdir_root
|
1183
|
+
@srcdir
|
1184
|
+
end
|
1185
|
+
|
1186
|
+
def objdir_root
|
1187
|
+
@objdir
|
1188
|
+
end
|
1189
|
+
|
1190
|
+
def relpath
|
1191
|
+
@currdir
|
1192
|
+
end
|
1176
1193
|
|
1177
1194
|
#
|
1178
1195
|
# Config Access
|
@@ -1205,21 +1222,29 @@ class Installer
|
|
1205
1222
|
exec_task_traverse 'config'
|
1206
1223
|
end
|
1207
1224
|
|
1208
|
-
|
1209
|
-
|
1225
|
+
def config_dir_bin(rel)
|
1226
|
+
end
|
1227
|
+
|
1228
|
+
def config_dir_lib(rel)
|
1229
|
+
end
|
1230
|
+
|
1231
|
+
def config_dir_man(rel)
|
1232
|
+
end
|
1210
1233
|
|
1211
1234
|
def config_dir_ext(rel)
|
1212
1235
|
extconf if extdir?(curr_srcdir())
|
1213
1236
|
end
|
1214
1237
|
|
1215
|
-
alias config_dir_data noop
|
1216
|
-
alias config_dir_conf noop
|
1217
|
-
alias config_dir_man noop
|
1218
|
-
|
1219
1238
|
def extconf
|
1220
1239
|
ruby "#{curr_srcdir()}/extconf.rb", *@config.config_opt
|
1221
1240
|
end
|
1222
1241
|
|
1242
|
+
def config_dir_data(rel)
|
1243
|
+
end
|
1244
|
+
|
1245
|
+
def config_dir_conf(rel)
|
1246
|
+
end
|
1247
|
+
|
1223
1248
|
#
|
1224
1249
|
# TASK setup
|
1225
1250
|
#
|
@@ -1230,89 +1255,43 @@ class Installer
|
|
1230
1255
|
|
1231
1256
|
def setup_dir_bin(rel)
|
1232
1257
|
files_of(curr_srcdir()).each do |fname|
|
1233
|
-
|
1258
|
+
adjust_shebang "#{curr_srcdir()}/#{fname}"
|
1234
1259
|
end
|
1235
1260
|
end
|
1236
1261
|
|
1237
|
-
|
1238
|
-
|
1239
|
-
def setup_dir_ext(rel)
|
1240
|
-
make if extdir?(curr_srcdir())
|
1241
|
-
end
|
1242
|
-
|
1243
|
-
alias setup_dir_data noop
|
1244
|
-
alias setup_dir_conf noop
|
1245
|
-
alias setup_dir_man noop
|
1246
|
-
|
1247
|
-
def update_shebang_line(path)
|
1262
|
+
def adjust_shebang(path)
|
1248
1263
|
return if no_harm?
|
1249
|
-
return if config('shebang') == 'never'
|
1250
|
-
old = Shebang.load(path)
|
1251
|
-
if old
|
1252
|
-
$stderr.puts "warning: #{path}: Shebang line includes too many args. It is not portable and your program may not work." if old.args.size > 1
|
1253
|
-
new = new_shebang(old)
|
1254
|
-
return if new.to_s == old.to_s
|
1255
|
-
else
|
1256
|
-
return unless config('shebang') == 'all'
|
1257
|
-
new = Shebang.new(config('rubypath'))
|
1258
|
-
end
|
1259
|
-
$stderr.puts "updating shebang: #{File.basename(path)}" if verbose?
|
1260
|
-
open_atomic_writer(path) {|output|
|
1261
|
-
File.open(path, 'rb') {|f|
|
1262
|
-
f.gets if old # discard
|
1263
|
-
output.puts new.to_s
|
1264
|
-
output.print f.read
|
1265
|
-
}
|
1266
|
-
}
|
1267
|
-
end
|
1268
|
-
|
1269
|
-
def new_shebang(old)
|
1270
|
-
if /\Aruby/ =~ File.basename(old.cmd)
|
1271
|
-
Shebang.new(config('rubypath'), old.args)
|
1272
|
-
elsif File.basename(old.cmd) == 'env' and old.args.first == 'ruby'
|
1273
|
-
Shebang.new(config('rubypath'), old.args[1..-1])
|
1274
|
-
else
|
1275
|
-
return old unless config('shebang') == 'all'
|
1276
|
-
Shebang.new(config('rubypath'))
|
1277
|
-
end
|
1278
|
-
end
|
1279
|
-
|
1280
|
-
def open_atomic_writer(path, &block)
|
1281
1264
|
tmpfile = File.basename(path) + '.tmp'
|
1282
1265
|
begin
|
1283
|
-
File.open(
|
1284
|
-
|
1266
|
+
File.open(path, 'rb') {|r|
|
1267
|
+
first = r.gets
|
1268
|
+
return unless File.basename(first.sub(/\A\#!/, '').split[0].to_s) == 'ruby'
|
1269
|
+
$stderr.puts "adjusting shebang: #{File.basename(path)}" if verbose?
|
1270
|
+
File.open(tmpfile, 'wb') {|w|
|
1271
|
+
w.print first.sub(/\A\#!\s*\S+/, '#! ' + config('rubypath'))
|
1272
|
+
w.write r.read
|
1273
|
+
}
|
1274
|
+
}
|
1275
|
+
move_file tmpfile, File.basename(path)
|
1285
1276
|
ensure
|
1286
1277
|
File.unlink tmpfile if File.exist?(tmpfile)
|
1287
1278
|
end
|
1288
1279
|
end
|
1289
1280
|
|
1290
|
-
|
1291
|
-
|
1292
|
-
line = nil
|
1293
|
-
File.open(path) {|f|
|
1294
|
-
line = f.gets
|
1295
|
-
}
|
1296
|
-
return nil unless /\A#!/ =~ line
|
1297
|
-
parse(line)
|
1298
|
-
end
|
1281
|
+
def setup_dir_lib(rel)
|
1282
|
+
end
|
1299
1283
|
|
1300
|
-
|
1301
|
-
|
1302
|
-
new(cmd, args)
|
1303
|
-
end
|
1284
|
+
def setup_dir_man(rel)
|
1285
|
+
end
|
1304
1286
|
|
1305
|
-
|
1306
|
-
|
1307
|
-
|
1308
|
-
end
|
1287
|
+
def setup_dir_ext(rel)
|
1288
|
+
make if extdir?(curr_srcdir())
|
1289
|
+
end
|
1309
1290
|
|
1310
|
-
|
1311
|
-
|
1291
|
+
def setup_dir_data(rel)
|
1292
|
+
end
|
1312
1293
|
|
1313
|
-
|
1314
|
-
"#! #{@cmd}" + (@args.empty? ? '' : " #{@args.join(' ')}")
|
1315
|
-
end
|
1294
|
+
def setup_dir_conf(rel)
|
1316
1295
|
end
|
1317
1296
|
|
1318
1297
|
#
|
@@ -1329,7 +1308,7 @@ class Installer
|
|
1329
1308
|
end
|
1330
1309
|
|
1331
1310
|
def install_dir_lib(rel)
|
1332
|
-
install_files
|
1311
|
+
install_files rubyscripts(), "#{config('rbdir')}/#{rel}", 0644
|
1333
1312
|
end
|
1334
1313
|
|
1335
1314
|
def install_dir_ext(rel)
|
@@ -1355,14 +1334,13 @@ class Installer
|
|
1355
1334
|
|
1356
1335
|
def install_files(list, dest, mode)
|
1357
1336
|
mkdir_p dest, @config.install_prefix
|
1358
|
-
#mkdir_p dest, offset_dir
|
1359
1337
|
list.each do |fname|
|
1360
1338
|
install fname, dest, mode, @config.install_prefix
|
1361
1339
|
end
|
1362
1340
|
end
|
1363
1341
|
|
1364
|
-
def
|
1365
|
-
|
1342
|
+
def rubyscripts
|
1343
|
+
glob_select(@config.libsrc_pattern, targetfiles())
|
1366
1344
|
end
|
1367
1345
|
|
1368
1346
|
def rubyextentions(dir)
|
@@ -1440,11 +1418,7 @@ class Installer
|
|
1440
1418
|
return
|
1441
1419
|
end
|
1442
1420
|
$stderr.puts 'Running tests...' if verbose?
|
1443
|
-
|
1444
|
-
require 'test/unit'
|
1445
|
-
rescue LoadError
|
1446
|
-
setup_rb_error 'test/unit cannot loaded. You need Ruby 1.8 or later to invoke this task.'
|
1447
|
-
end
|
1421
|
+
require 'test/unit'
|
1448
1422
|
runner = Test::Unit::AutoRunner.new(true)
|
1449
1423
|
runner.to_run << TESTDIR
|
1450
1424
|
runner.run
|
@@ -1460,17 +1434,23 @@ class Installer
|
|
1460
1434
|
rm_f 'InstalledFiles'
|
1461
1435
|
end
|
1462
1436
|
|
1463
|
-
|
1464
|
-
|
1465
|
-
|
1466
|
-
|
1467
|
-
|
1437
|
+
def clean_dir_bin(rel)
|
1438
|
+
end
|
1439
|
+
|
1440
|
+
def clean_dir_lib(rel)
|
1441
|
+
end
|
1468
1442
|
|
1469
1443
|
def clean_dir_ext(rel)
|
1470
1444
|
return unless extdir?(curr_srcdir())
|
1471
1445
|
make 'clean' if File.file?('Makefile')
|
1472
1446
|
end
|
1473
1447
|
|
1448
|
+
def clean_dir_data(rel)
|
1449
|
+
end
|
1450
|
+
|
1451
|
+
def clean_dir_conf(rel)
|
1452
|
+
end
|
1453
|
+
|
1474
1454
|
#
|
1475
1455
|
# TASK distclean
|
1476
1456
|
#
|
@@ -1481,26 +1461,31 @@ class Installer
|
|
1481
1461
|
rm_f 'InstalledFiles'
|
1482
1462
|
end
|
1483
1463
|
|
1484
|
-
|
1485
|
-
|
1464
|
+
def distclean_dir_bin(rel)
|
1465
|
+
end
|
1466
|
+
|
1467
|
+
def distclean_dir_lib(rel)
|
1468
|
+
end
|
1486
1469
|
|
1487
1470
|
def distclean_dir_ext(rel)
|
1488
1471
|
return unless extdir?(curr_srcdir())
|
1489
1472
|
make 'distclean' if File.file?('Makefile')
|
1490
1473
|
end
|
1491
1474
|
|
1492
|
-
|
1493
|
-
|
1494
|
-
|
1475
|
+
def distclean_dir_data(rel)
|
1476
|
+
end
|
1477
|
+
|
1478
|
+
def distclean_dir_conf(rel)
|
1479
|
+
end
|
1495
1480
|
|
1496
1481
|
#
|
1497
|
-
#
|
1482
|
+
# lib
|
1498
1483
|
#
|
1499
1484
|
|
1500
1485
|
def exec_task_traverse(task)
|
1501
1486
|
run_hook "pre-#{task}"
|
1502
1487
|
FILETYPES.each do |type|
|
1503
|
-
if
|
1488
|
+
if config('without-ext') == 'yes' and type == 'ext'
|
1504
1489
|
$stderr.puts 'skipping ext/* by user option' if verbose?
|
1505
1490
|
next
|
1506
1491
|
end
|