reap 9.3.5 → 9.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +10 -0
- data/MANIFEST +37 -21
- data/NOTES +13 -11
- data/bin/reap-announce +40 -2
- data/bin/reap-check-load +20 -2
- data/bin/reap-check-syntax +20 -2
- data/bin/reap-clean +24 -2
- data/bin/reap-clobber +17 -2
- data/bin/reap-doc +12 -2
- data/bin/reap-doc-rdoc +17 -2
- data/bin/reap-doc-ri +16 -2
- data/bin/reap-doc-spec +18 -0
- data/bin/reap-init +9 -0
- data/bin/reap-inspect +20 -2
- data/bin/reap-install +13 -2
- data/bin/reap-install-gem +14 -2
- data/bin/reap-log +15 -2
- data/bin/reap-log-changes +15 -2
- data/bin/reap-log-notes +20 -2
- data/bin/reap-make +16 -2
- data/bin/reap-make-clean +10 -2
- data/bin/reap-make-distclean +18 -2
- data/bin/reap-make-extconf +14 -2
- data/bin/reap-make-static +14 -2
- data/bin/reap-package +25 -2
- data/bin/reap-package-gem +14 -2
- data/bin/reap-package-tgz +14 -2
- data/bin/reap-package-zip +14 -2
- data/bin/reap-prepare +21 -2
- data/bin/reap-publish +25 -2
- data/bin/reap-release +22 -2
- data/bin/reap-rollout +32 -2
- data/bin/reap-scaffold +16 -2
- data/bin/reap-scm-branch +13 -2
- data/bin/reap-scm-tag +13 -2
- data/bin/reap-spec +14 -2
- data/bin/reap-stats +21 -2
- data/bin/reap-test +14 -2
- data/bin/reap-test-cross +23 -2
- data/bin/reap-test-load +17 -2
- data/bin/reap-test-solo +19 -2
- data/bin/reap-uninstall +14 -2
- data/bin/reap-uninstall-gem +17 -2
- data/bin/reap-version +10 -2
- data/lib/reap/announcement.rb +136 -0
- data/lib/reap/application.rb +3 -1
- data/lib/reap/default.yaml +12 -12
- data/lib/reap/defaults.rb +49 -0
- data/lib/reap/emailer.rb +189 -0
- data/lib/reap/extensions.rb +1 -2
- data/lib/reap/hosts.rb +4 -0
- data/lib/reap/hosts/host.rb +69 -0
- data/lib/reap/hosts/mailinglist.rb +83 -0
- data/lib/reap/{systems → hosts}/rubyforge.rb +72 -60
- data/lib/reap/hosts/rubytalk.rb +39 -0
- data/lib/reap/iobject.rb +5 -3
- data/lib/reap/metadata.rb +31 -4
- data/lib/reap/project.rb +101 -41
- data/lib/reap/project/announce.rb +50 -180
- data/lib/reap/project/check.rb +1 -1
- data/lib/reap/project/gem.rb +32 -68
- data/lib/reap/project/log.rb +12 -7
- data/lib/reap/project/make.rb +0 -1
- data/lib/reap/project/package.rb +228 -75
- data/lib/reap/project/rdoc.rb +9 -8
- data/lib/reap/project/release.rb +52 -6
- data/lib/reap/project/scm.rb +40 -25
- data/lib/reap/project/spec.rb +3 -3
- data/lib/reap/project/test.rb +1 -2
- data/lib/reap/project/version.rb +18 -4
- data/lib/reap/runmodes.rb +24 -0
- data/lib/reap/settings.rb +3 -14
- data/lib/reap/systems.rb +4 -0
- data/lib/reap/systems/git.rb +0 -0
- data/lib/reap/systems/hg.rb +0 -0
- data/lib/reap/systems/{subversion.rb → svn.rb} +47 -16
- data/lib/reap/systems/system.rb +53 -0
- data/lib/reap/tool.rb +38 -0
- data/lib/reap/utilities.rb +43 -86
- data/log/{Changelog.txt → changelog.rdoc} +56 -0
- data/log/fixme.rdoc +25 -0
- data/log/todo.rdoc +85 -0
- data/meta/project.yaml +13 -2
- data/meta/version +1 -0
- data/setup.rb +74 -64
- data/task/allshare.rb +109 -0
- data/task/clean +13 -0
- data/task/compile +28 -0
- data/task/configure +372 -0
- data/task/install +1481 -0
- data/test/case/test_init.rb +32 -0
- data/test/case/test_scaffold.rb +32 -0
- data/test/data/scaffold/meta/project.yaml +28 -0
- data/test/lib/case_testable.rb +23 -0
- metadata +64 -31
- data/bin/reap-spec-doc +0 -8
- data/demo/README +0 -15
- data/demo/lib/foo/foo.rb +0 -7
- data/demo/meta/VERSION +0 -1
- data/demo/meta/project.yaml +0 -21
- data/lib/reap/project/rubyforge.rb +0 -71
- data/lib/reap/project/svn.rb +0 -76
- data/log/Fixme.txt +0 -22
- data/log/Todo.txt +0 -84
- data/meta/VERSION +0 -1
data/lib/reap/project/check.rb
CHANGED
@@ -58,7 +58,7 @@ module Reap
|
|
58
58
|
# This takes one option +:scripts+ which is a glob or list of globs
|
59
59
|
# of the scripts to check. By default this is all scripts in the libpath(s).
|
60
60
|
#
|
61
|
-
# FIXME: This isn't routing output to dev/null as expected
|
61
|
+
# FIXME: This isn't routing output to dev/null as expected ?
|
62
62
|
|
63
63
|
def check_load(options=nil)
|
64
64
|
options = configure_options(options, 'check-load', 'check')
|
data/lib/reap/project/gem.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
#require 'facets/project/package'
|
2
|
+
|
1
3
|
module Reap
|
2
4
|
|
3
5
|
class Project
|
@@ -19,59 +21,7 @@ module Reap
|
|
19
21
|
# TODO: Should this use staging too, like zip/tgz?
|
20
22
|
|
21
23
|
def gem_package(options=nil)
|
22
|
-
|
23
|
-
require 'rubygems/specification'
|
24
|
-
Gem::manage_gems
|
25
|
-
rescue LoadError
|
26
|
-
#raise LoadError, "RubyGems is not installed?"
|
27
|
-
end
|
28
|
-
|
29
|
-
options = configure_options(options, 'package-gem', 'package')
|
30
|
-
|
31
|
-
prepare(options)
|
32
|
-
|
33
|
-
package = metadata.clone
|
34
|
-
package.update(options)
|
35
|
-
|
36
|
-
abort "No name" unless package.name
|
37
|
-
abort "No version" unless package.version
|
38
|
-
|
39
|
-
store = 'pkg' #package.package_directory
|
40
|
-
fname = package.stage_name
|
41
|
-
files = package.filelist
|
42
|
-
|
43
|
-
stage = File.join(store, fname)
|
44
|
-
pfile = stage + ".gem"
|
45
|
-
|
46
|
-
unless out_of_date?(pfile, *files) or force?
|
47
|
-
report_package_already_built(pfile)
|
48
|
-
return
|
49
|
-
end
|
50
|
-
|
51
|
-
rm_r(stage) if File.exist?(stage) # remove old stage
|
52
|
-
stage(stage, files) # make new stage
|
53
|
-
package_manifest(stage) # generate manifest
|
54
|
-
|
55
|
-
if dryrun?
|
56
|
-
status "gem build #{stage}"
|
57
|
-
else
|
58
|
-
file = nil
|
59
|
-
cd(stage) do
|
60
|
-
#status "vi #{metadata.name}.gemspec"
|
61
|
-
builder = ::Gem::Builder.new(gemspec(package))
|
62
|
-
status "gem build #{stage}"
|
63
|
-
unless dryrun?
|
64
|
-
file = builder.build
|
65
|
-
file = File.expand_path(file)
|
66
|
-
end
|
67
|
-
end
|
68
|
-
# transfer gem package to package store
|
69
|
-
mkdir_p(store)
|
70
|
-
destination = File.join(store, File.basename(file))
|
71
|
-
mv(file, store) unless File.expand_path(file) == File.expand_path(destination)
|
72
|
-
end
|
73
|
-
|
74
|
-
return destination
|
24
|
+
return package_gem(options=nil)
|
75
25
|
end
|
76
26
|
|
77
27
|
# Install gem package, creating the package if not already created.
|
@@ -120,8 +70,7 @@ module Reap
|
|
120
70
|
spec.rubyforge_project = rubyforge_project
|
121
71
|
spec.homepage = package.homepage
|
122
72
|
|
123
|
-
#
|
124
|
-
spec.platform = 'ruby' # TODO current support!
|
73
|
+
spec.platform = package.platform #'ruby'
|
125
74
|
|
126
75
|
spec.require_paths = [package.loadpath].flatten
|
127
76
|
|
@@ -133,34 +82,49 @@ module Reap
|
|
133
82
|
spec.executables = package.executables
|
134
83
|
spec.requirements = package.requirements
|
135
84
|
|
136
|
-
# TODO: Looks like there is no choice but to auto-rdoc gem install.
|
137
|
-
spec.has_rdoc = !(FalseClass===package.document)
|
138
|
-
|
139
85
|
if package.dependencies
|
140
86
|
package.dependencies.each do |d,v|
|
141
87
|
spec.add_dependency(*[d,v].compact)
|
142
88
|
end
|
143
89
|
end
|
144
90
|
|
145
|
-
spec.extensions = package.
|
91
|
+
spec.extensions = [package.extensions].flatten.compact
|
92
|
+
|
93
|
+
# rdocs (argh!)
|
94
|
+
|
95
|
+
readme = Dir.glob('README{,.txt}', File::FNM_CASEFOLD).first
|
96
|
+
|
97
|
+
spec.has_rdoc = package.autodoc # Make true always?
|
98
|
+
|
99
|
+
rdocfiles = []
|
100
|
+
rdocfiles << readme if readme
|
101
|
+
rdocfiles.concat(Dir['[A-Z]*'] || []) # package.document
|
102
|
+
rdocfiles.uniq!
|
103
|
+
spec.extra_rdoc_files = rdocfiles
|
104
|
+
|
105
|
+
rdoc_options = ['--inline-source']
|
106
|
+
rdoc_options.concat ["--title", package.title] if package.title
|
107
|
+
rdoc_options.concat ["--main", readme] if readme
|
108
|
+
spec.rdoc_options = rdoc_options
|
146
109
|
|
147
110
|
spec.files = distribute
|
148
111
|
|
149
|
-
|
112
|
+
# TODO make test_files configurable (?)
|
113
|
+
spec.test_files = distribute.select{ |f| f =~ /^test\// }
|
150
114
|
end
|
151
115
|
end
|
152
116
|
|
153
117
|
# Report that a package has been built.
|
154
118
|
# FIXME
|
155
119
|
|
156
|
-
def report_package_built(type, file)
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
end
|
120
|
+
#def report_package_built(type, file)
|
121
|
+
# r = ''
|
122
|
+
# r << "\n Successfully built #{type}"
|
123
|
+
# r << "\n Name: #{package.name}"
|
124
|
+
# r << "\n Version: #{package.version}"
|
125
|
+
# r << "\n File: #{File.basename(file)}"
|
126
|
+
# say r
|
127
|
+
#end
|
164
128
|
|
165
129
|
end
|
166
130
|
end
|
data/lib/reap/project/log.rb
CHANGED
@@ -53,9 +53,11 @@ module Reap
|
|
53
53
|
if records.empty?
|
54
54
|
puts "No #{labels.join(', ')} notes."
|
55
55
|
else
|
56
|
-
log_notes_save(output, notes, labels)
|
56
|
+
files_saved = log_notes_save(output, notes, labels)
|
57
|
+
files_saved.each do |file|
|
58
|
+
puts "Updated #{file}"
|
59
|
+
end
|
57
60
|
puts counts.collect{|l,n| "#{n} #{l}s"}.join(', ')
|
58
|
-
puts "Notes saved in #{output} folder."
|
59
61
|
end
|
60
62
|
end
|
61
63
|
|
@@ -115,7 +117,7 @@ module Reap
|
|
115
117
|
if last_file != record['file']
|
116
118
|
out << "\n"
|
117
119
|
last_file = record['file']
|
118
|
-
out << "file://#{record['file']}\n"
|
120
|
+
out << "== file://#{record['file']}\n"
|
119
121
|
end
|
120
122
|
out << "* #{record['note'].rstrip} (#{record['line']})\n"
|
121
123
|
end
|
@@ -127,6 +129,7 @@ module Reap
|
|
127
129
|
# Save notes.
|
128
130
|
|
129
131
|
def log_notes_save(dir, notes, labels)
|
132
|
+
files_saved = []
|
130
133
|
mkdir_p(dir)
|
131
134
|
# Remove empty note files.
|
132
135
|
(labels - notes.keys).each do |label|
|
@@ -135,22 +138,24 @@ module Reap
|
|
135
138
|
end
|
136
139
|
# Create note files.
|
137
140
|
notes.each do |label, note|
|
138
|
-
file = apply_naming_policy(label, '
|
141
|
+
file = apply_naming_policy(label, 'rdoc')
|
139
142
|
file = File.join(dir,file)
|
140
143
|
if dryrun?
|
141
144
|
puts "write #{file}"
|
142
145
|
else
|
143
|
-
|
146
|
+
files_saved << file
|
147
|
+
File.open(file,'w') do |f| f << note end
|
144
148
|
end
|
145
149
|
end
|
150
|
+
return files_saved
|
146
151
|
end
|
147
152
|
|
148
153
|
#
|
149
154
|
|
150
155
|
def naming_policy
|
151
156
|
@naming_policy ||= (
|
152
|
-
logconfig =
|
153
|
-
policy = logconfig['policy'] || ['
|
157
|
+
logconfig = settings['log'] || {}
|
158
|
+
policy = logconfig['policy'] || ['down', 'ext']
|
154
159
|
list_option(policy)
|
155
160
|
)
|
156
161
|
end
|
data/lib/reap/project/make.rb
CHANGED
data/lib/reap/project/package.rb
CHANGED
@@ -1,9 +1,25 @@
|
|
1
1
|
require 'reap/project/gem'
|
2
|
+
require 'facets/platform'
|
3
|
+
#require 'facets/kernel/silence'
|
2
4
|
|
3
5
|
module Reap
|
4
6
|
|
5
7
|
class Project
|
6
8
|
|
9
|
+
PACKAGE_STORE = 'pkg'
|
10
|
+
|
11
|
+
# Returns the package storage directory (now constant 'pkg').
|
12
|
+
|
13
|
+
def package_store
|
14
|
+
PACKAGE_STORE
|
15
|
+
end
|
16
|
+
|
17
|
+
# Current platform.
|
18
|
+
|
19
|
+
def current_platform
|
20
|
+
Platform.local.to_s
|
21
|
+
end
|
22
|
+
|
7
23
|
# Remove packages.
|
8
24
|
|
9
25
|
def clobber_packages(options=nil)
|
@@ -19,7 +35,7 @@ module Reap
|
|
19
35
|
end
|
20
36
|
end
|
21
37
|
|
22
|
-
# Prepare for packaging (clean, distclean, stamp).
|
38
|
+
# Prepare for packaging (clean, distclean, version stamp).
|
23
39
|
#
|
24
40
|
# TODO: When we add support for binary packages distclean
|
25
41
|
# should not be done for them.
|
@@ -38,62 +54,99 @@ module Reap
|
|
38
54
|
def package(options=nil)
|
39
55
|
packopts = configure_options(options, 'package')
|
40
56
|
|
41
|
-
formats = packopts['formats'] || ['
|
57
|
+
formats = packopts['formats'] || ['gem', 'tgz']
|
42
58
|
formats = [formats].flatten
|
43
59
|
|
44
60
|
prepare(options)
|
45
61
|
|
46
62
|
puts unless dryrun?
|
63
|
+
|
47
64
|
formats.each do |format|
|
48
65
|
send("package_#{format}", options)
|
49
|
-
puts unless dryrun?
|
66
|
+
#puts unless dryrun?
|
50
67
|
end
|
51
68
|
end
|
52
69
|
|
53
|
-
# Routes to
|
70
|
+
# Routes to #gem_package.
|
54
71
|
|
55
72
|
def package_gem(options=nil)
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
options = configure_options(options, 'package-tgz', 'package')
|
63
|
-
|
64
|
-
prepare(options)
|
73
|
+
begin
|
74
|
+
require 'rubygems/specification'
|
75
|
+
Gem::manage_gems
|
76
|
+
rescue LoadError
|
77
|
+
#raise LoadError, "RubyGems is not installed?"
|
78
|
+
end
|
65
79
|
|
66
|
-
|
67
|
-
|
80
|
+
options = configure_options(options, 'package-gem', 'package')
|
81
|
+
extension = '.gem'
|
82
|
+
|
83
|
+
platform = options.delete('platform') || 'none'
|
84
|
+
|
85
|
+
platforms = []
|
86
|
+
platforms << nil if platform != 'only'
|
87
|
+
platforms << 'current' if platform != 'none'
|
88
|
+
|
89
|
+
platforms.each do |pl|
|
90
|
+
options['platform'] = pl
|
91
|
+
fname, metadata = package_prepare_stage(extension, options)
|
92
|
+
next unless fname # if already built
|
93
|
+
stage = File.join(package_store, fname)
|
94
|
+
if dryrun?
|
95
|
+
status "gem build #{stage}"
|
96
|
+
else
|
97
|
+
file = nil
|
98
|
+
cd(stage) do
|
99
|
+
#status "vi #{metadata.name}.gemspec"
|
100
|
+
builder = ::Gem::Builder.new(gemspec(metadata))
|
101
|
+
status "gem build #{stage}"
|
102
|
+
unless dryrun?
|
103
|
+
file = builder.build
|
104
|
+
file = File.expand_path(file)
|
105
|
+
end
|
106
|
+
end
|
107
|
+
# transfer gem package to package store
|
108
|
+
mkdir_p(package_store)
|
109
|
+
destination = File.join(package_store, File.basename(file))
|
110
|
+
mv(file, package_store) unless File.expand_path(file) == File.expand_path(destination)
|
111
|
+
puts
|
112
|
+
end
|
113
|
+
end
|
114
|
+
end
|
68
115
|
|
69
|
-
|
70
|
-
|
116
|
+
# Create a Gem package.
|
117
|
+
#
|
118
|
+
# TODO: Should this use staging too, like zip/tgz?
|
71
119
|
|
72
|
-
|
73
|
-
|
74
|
-
files = package.filelist
|
120
|
+
#def gem_package(options=nil)
|
121
|
+
#end
|
75
122
|
|
76
|
-
stage = File.join(store, fname)
|
77
|
-
pfile = stage + ".tgz"
|
78
123
|
|
79
|
-
|
80
|
-
report_package_already_built(pfile)
|
81
|
-
return
|
82
|
-
end
|
124
|
+
# Create a Tar'd Gzip package.
|
83
125
|
|
84
|
-
|
85
|
-
|
86
|
-
package_manifest(stage) # generate stage manifest
|
126
|
+
def package_tgz(options=nil)
|
127
|
+
options = configure_options(options, 'package-tgz', 'package')
|
87
128
|
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
129
|
+
platform = options.delete('platform') || 'none'
|
130
|
+
extension = '.tgz'
|
131
|
+
|
132
|
+
platforms = []
|
133
|
+
platforms << nil if platform != 'only'
|
134
|
+
platforms << current_platform if platform != 'none'
|
135
|
+
|
136
|
+
platforms.each do |pl|
|
137
|
+
options['platform'] = pl
|
138
|
+
fname, metadata = package_prepare_stage(extension, options)
|
139
|
+
next unless fname # if already built
|
140
|
+
if dryrun?
|
141
|
+
status "tar -cxf #{fname}.tgz"
|
142
|
+
else
|
143
|
+
file = nil
|
144
|
+
cd(package_store) do
|
145
|
+
file = compress(:tgz, fname)
|
146
|
+
end
|
147
|
+
transfer(file, package_store)
|
148
|
+
report_package_built(file)
|
94
149
|
end
|
95
|
-
transfer(file, store)
|
96
|
-
report_package_built(file)
|
97
150
|
end
|
98
151
|
end
|
99
152
|
|
@@ -102,59 +155,91 @@ module Reap
|
|
102
155
|
def package_zip(options=nil)
|
103
156
|
options = configure_options(options, 'package-zip', 'package')
|
104
157
|
|
105
|
-
|
158
|
+
platform = options.delete('platform') || 'none'
|
159
|
+
extension = '.zip'
|
160
|
+
|
161
|
+
platforms = []
|
162
|
+
platforms << nil if platform != 'only'
|
163
|
+
platforms << current_platform if platform != 'none'
|
164
|
+
|
165
|
+
platforms.each do |pl|
|
166
|
+
options['platform'] = pl
|
167
|
+
fname, metadata = package_prepare_stage(extension, options)
|
168
|
+
next unless fname # if already built
|
169
|
+
if dryrun?
|
170
|
+
status "zip -r #{fname}.zip ."
|
171
|
+
else
|
172
|
+
file = nil
|
173
|
+
cd(package_store) do
|
174
|
+
file = compress(:zip, fname)
|
175
|
+
end
|
176
|
+
transfer(file, package_store)
|
177
|
+
report_package_built(file)
|
178
|
+
end
|
179
|
+
end
|
180
|
+
end
|
106
181
|
|
107
|
-
|
108
|
-
|
182
|
+
# Create off-line documentation package.
|
183
|
+
#
|
184
|
+
# FIXME: package_docs is not yet ready for use.
|
185
|
+
#
|
186
|
+
#def package_docs(options=nil)
|
187
|
+
# options = configure_options(options, 'package-doc')
|
188
|
+
#
|
189
|
+
# dir = options['dir'] || 'doc'
|
190
|
+
# name = options['name'] || metadata.name
|
191
|
+
# ver = options['version'] || metadata.version
|
192
|
+
#
|
193
|
+
# cd(dir) do
|
194
|
+
# zip "-czhvf #{name}-docs-#{ver}.zip *"
|
195
|
+
# end
|
196
|
+
#end
|
109
197
|
|
110
|
-
|
111
|
-
abort "No version" unless package.version
|
198
|
+
private
|
112
199
|
|
113
|
-
|
114
|
-
fname = package.stage_name
|
115
|
-
files = package.filelist
|
200
|
+
#
|
116
201
|
|
117
|
-
|
118
|
-
|
202
|
+
def package_prepare_stage(extension, options)
|
203
|
+
prepare(options)
|
119
204
|
|
120
|
-
|
121
|
-
|
122
|
-
return
|
123
|
-
end
|
205
|
+
metadata = metadata().clone
|
206
|
+
metadata.update(options)
|
124
207
|
|
125
|
-
|
126
|
-
|
127
|
-
package_manifest(stage) # generate manifest
|
208
|
+
abort "No name" unless metadata.name
|
209
|
+
abort "No version" unless metadata.version
|
128
210
|
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
211
|
+
fname = metadata.stage_name
|
212
|
+
|
213
|
+
if compiles?
|
214
|
+
streams = verbose? ? [] : [STDOUT, STDERR]
|
215
|
+
silence_stream(*streams) do
|
216
|
+
make_distclean
|
217
|
+
# If platform package then pre-compile
|
218
|
+
if options['platform']
|
219
|
+
make
|
220
|
+
end
|
135
221
|
end
|
136
|
-
transfer(file, store)
|
137
|
-
report_package_built(file)
|
138
222
|
end
|
139
|
-
end
|
140
223
|
|
141
|
-
|
142
|
-
#
|
143
|
-
# FIXME: package_docs is not yet ready for use.
|
224
|
+
stage = File.join(package_store, fname)
|
144
225
|
|
145
|
-
|
146
|
-
options = configure_options(options, 'package-doc')
|
226
|
+
pfile = stage + extension #".tgz"
|
147
227
|
|
148
|
-
|
149
|
-
name = options['name'] || metadata.name
|
150
|
-
ver = options['version'] || metadata.version
|
228
|
+
files = metadata.filelist
|
151
229
|
|
152
|
-
|
153
|
-
|
230
|
+
unless out_of_date?(pfile, *files) or force?
|
231
|
+
report_package_already_built(pfile)
|
232
|
+
return nil, metadata
|
154
233
|
end
|
155
|
-
end
|
156
234
|
|
157
|
-
|
235
|
+
rm_r(stage) if File.exist?(stage) # remove old stage
|
236
|
+
|
237
|
+
stage(stage, files) # make new stage
|
238
|
+
|
239
|
+
package_manifest(stage) # generate stage manifest
|
240
|
+
|
241
|
+
return fname, metadata
|
242
|
+
end
|
158
243
|
|
159
244
|
# Transfer package file to storage location.
|
160
245
|
|
@@ -191,6 +276,7 @@ module Reap
|
|
191
276
|
puts " Name: #{name}"
|
192
277
|
puts " Version: #{vers}"
|
193
278
|
puts " File: #{file}"
|
279
|
+
puts
|
194
280
|
end
|
195
281
|
|
196
282
|
# Report that a package has been built.
|
@@ -203,6 +289,7 @@ module Reap
|
|
203
289
|
vers = file[file.rindex('-')+1..-1].chomp(type)
|
204
290
|
|
205
291
|
puts " Package #{file} is already current."
|
292
|
+
puts
|
206
293
|
#puts " Name: #{name}"
|
207
294
|
#puts " Version: #{vers}"
|
208
295
|
#puts " File: #{file}"
|
@@ -246,3 +333,69 @@ end
|
|
246
333
|
# def report_packaging_complete(size)
|
247
334
|
# say "\nSuccessfully built #{size} packages at #{store}/."
|
248
335
|
# end
|
336
|
+
|
337
|
+
|
338
|
+
=begin
|
339
|
+
prepare(options)
|
340
|
+
|
341
|
+
package = metadata.clone
|
342
|
+
package.update(options)
|
343
|
+
|
344
|
+
abort "No name" unless package.name
|
345
|
+
abort "No version" unless package.version
|
346
|
+
|
347
|
+
fname = package.stage_name
|
348
|
+
files = package.filelist
|
349
|
+
|
350
|
+
stage = File.join(package_store, fname)
|
351
|
+
pfile = stage + ".zip"
|
352
|
+
|
353
|
+
unless out_of_date?(pfile, *files) or force?
|
354
|
+
report_package_already_built(pfile)
|
355
|
+
return
|
356
|
+
end
|
357
|
+
|
358
|
+
rm_r(stage) if File.exist?(stage) # remove old stage
|
359
|
+
stage(stage, files) # make new stage
|
360
|
+
package_manifest(stage) # generate manifest
|
361
|
+
|
362
|
+
if dryrun?
|
363
|
+
status "zip -r #{fname}.zip ."
|
364
|
+
else
|
365
|
+
file = nil
|
366
|
+
cd(package_store) do
|
367
|
+
file = zip(fname)
|
368
|
+
end
|
369
|
+
transfer(file, package_store)
|
370
|
+
report_package_built(file)
|
371
|
+
end
|
372
|
+
=end
|
373
|
+
|
374
|
+
=begin
|
375
|
+
prepare(options)
|
376
|
+
|
377
|
+
package = metadata.clone
|
378
|
+
package.update(options)
|
379
|
+
|
380
|
+
abort "No name" unless package.name
|
381
|
+
abort "No version" unless package.version
|
382
|
+
|
383
|
+
store = 'pkg' #package.package_directory
|
384
|
+
fname = package.stage_name
|
385
|
+
files = package.filelist
|
386
|
+
|
387
|
+
stage = File.join(store, fname)
|
388
|
+
|
389
|
+
pfile = stage + ".tgz"
|
390
|
+
|
391
|
+
unless out_of_date?(pfile, *files) or force?
|
392
|
+
report_package_already_built(pfile)
|
393
|
+
return
|
394
|
+
end
|
395
|
+
|
396
|
+
rm_r(stage) if File.exist?(stage) # remove old stage
|
397
|
+
stage(stage, files) # make new stage
|
398
|
+
|
399
|
+
package_manifest(stage) # generate stage manifest
|
400
|
+
=end
|
401
|
+
|