autoproj 1.2.1 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +11 -0
- data/bin/autoproj +25 -5
- data/doc/guide/src/autoproj_bootstrap +34 -12
- data/lib/autoproj/default.osdeps +17 -10
- data/lib/autoproj/manifest.rb +17 -1
- data/lib/autoproj/osdeps.rb +10 -1
- data/lib/autoproj/version.rb +1 -1
- metadata +2 -2
data/History.txt
CHANGED
@@ -1,3 +1,14 @@
|
|
1
|
+
= Version 1.2.2
|
2
|
+
* added support for Gentoo
|
3
|
+
* added support for Ubuntu 9.10 [Karmic Koala]
|
4
|
+
* add the 'fast-build' mode which is equivalent to
|
5
|
+
"build --no-update --no-osdeps"
|
6
|
+
* add a quick bootstrap method [still experimental]
|
7
|
+
If an autoproj installation is already present, one can simply run autoproj
|
8
|
+
bootstrap [options]. It speeds up the bootstrapping as the gems are taken
|
9
|
+
from the other installation.
|
10
|
+
* minor bugfixes and improvements
|
11
|
+
|
1
12
|
= Version 1.2.1
|
2
13
|
* accept two layouts for version control description:
|
3
14
|
|
data/bin/autoproj
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
#! /usr/bin/env ruby
|
2
2
|
|
3
|
+
if RUBY_VERSION < "1.8.7"
|
4
|
+
STDERR.puts "autoproj requires Ruby >= 1.8.7"
|
5
|
+
exit 1
|
6
|
+
end
|
7
|
+
|
3
8
|
require 'autoproj'
|
4
9
|
require 'autoproj/autobuild'
|
5
10
|
require 'open-uri'
|
@@ -32,6 +37,7 @@ autoproj mode [options]
|
|
32
37
|
where 'mode' is one of:
|
33
38
|
build: import, build and install all selected packages
|
34
39
|
force-build: triggers all build commands, i.e. don't be lazy like in "build"
|
40
|
+
fast-build: builds without updating and installing OS dependencies
|
35
41
|
rebuild: remove all build products, thus triggering a full rebuild
|
36
42
|
doc: generate and install documentation for packages that have some
|
37
43
|
update: only import/update packages, do not build them
|
@@ -193,8 +199,11 @@ def do_bootstrap(*args)
|
|
193
199
|
# Check if we are being called from another GEM_HOME. If it is the case,
|
194
200
|
# assume that we are bootstrapping from another installation directory and
|
195
201
|
# start by copying the .gems directory
|
196
|
-
if ENV['GEM_HOME'] && ENV['GEM_HOME'] != File.join(Dir.pwd, ".gems")
|
202
|
+
if ENV['GEM_HOME'] && ENV['GEM_HOME'] =~ /\.gems\/?$/ && ENV['GEM_HOME'] != File.join(Dir.pwd, ".gems")
|
203
|
+
STDERR.puts "autoproj: reusing bootstrap from #{File.dirname(ENV['GEM_HOME'])}"
|
197
204
|
FileUtils.cp_r ENV['GEM_HOME'], ".gems"
|
205
|
+
ENV['GEM_HOME'] = File.join(Dir.pwd, ".gems")
|
206
|
+
exec $0, *ARGV
|
198
207
|
end
|
199
208
|
|
200
209
|
# If we are not getting the installation setup from a VCS, copy the template
|
@@ -290,6 +299,9 @@ begin
|
|
290
299
|
Autobuild.do_forced_build = true
|
291
300
|
when "rebuild"
|
292
301
|
Autobuild.do_rebuild = true
|
302
|
+
when "fast-build"
|
303
|
+
Autobuild.do_update = false
|
304
|
+
no_os_deps = true
|
293
305
|
when "update"
|
294
306
|
Autobuild.do_build = false
|
295
307
|
when "status"
|
@@ -325,6 +337,7 @@ begin
|
|
325
337
|
# Set up some important autobuild parameters
|
326
338
|
Autoproj.env_inherit 'PATH', 'PKG_CONFIG_PATH', 'RUBYLIB'
|
327
339
|
Autoproj.env_set 'GEM_HOME', Autoproj.gem_home
|
340
|
+
Autoproj.env_set 'RUBYOPT', "-rubygems"
|
328
341
|
Autobuild.prefix = Autoproj.build_dir
|
329
342
|
Autobuild.srcdir = root_dir
|
330
343
|
Autobuild.logdir = File.join(Autobuild.prefix, 'log')
|
@@ -511,6 +524,7 @@ begin
|
|
511
524
|
all_enabled_packages = Set.new
|
512
525
|
STDERR.puts
|
513
526
|
if only_do_status
|
527
|
+
STDERR.puts color("autoproj: status of packages in #{name}", :bold)
|
514
528
|
do_status(enabled_packages)
|
515
529
|
elsif !enabled_packages.empty?
|
516
530
|
Autobuild::Reporting.report do
|
@@ -581,7 +595,9 @@ begin
|
|
581
595
|
begin
|
582
596
|
Autobuild.do_update = false
|
583
597
|
Autobuild::Reporting.report do
|
584
|
-
prepare_targets = (packages - enabled_packages).
|
598
|
+
prepare_targets = (packages - enabled_packages).
|
599
|
+
find_all { |pkg_name| File.directory?(Autobuild::Package[pkg_name].srcdir) }.
|
600
|
+
map { |pkg_name| "#{pkg_name}-prepare" }
|
585
601
|
task "autoproj-#{name}-prepare" => prepare_targets
|
586
602
|
Rake::Task["autoproj-#{name}-prepare"].invoke
|
587
603
|
end
|
@@ -589,9 +605,13 @@ begin
|
|
589
605
|
Autobuild.do_update = old_update_flag
|
590
606
|
end
|
591
607
|
|
592
|
-
if mode == "build"
|
593
|
-
|
594
|
-
|
608
|
+
if (mode == "build" || mode == "fast-build")
|
609
|
+
if packages.all? { |pkg_name| File.directory?(Autobuild::Package[pkg_name].srcdir) }
|
610
|
+
all_env_sh << name
|
611
|
+
Autoproj.export_env_sh(name)
|
612
|
+
else
|
613
|
+
STDERR.puts color("WARN: #{name} has not been completely built, #{name}env.sh is not updated", :magenta)
|
614
|
+
end
|
595
615
|
end
|
596
616
|
end
|
597
617
|
|
@@ -1,5 +1,10 @@
|
|
1
1
|
#! /usr/bin/ruby
|
2
2
|
|
3
|
+
if RUBY_VERSION < "1.8.7"
|
4
|
+
STDERR.puts "autoproj requires Ruby >= 1.8.7"
|
5
|
+
exit 1
|
6
|
+
end
|
7
|
+
|
3
8
|
ENV['GEM_HOME'] = "#{Dir.pwd}/.gems"
|
4
9
|
ENV['PATH'] = "#{ENV['GEM_HOME']}/bin:#{ENV['PATH']}"
|
5
10
|
if $LOADED_FEATURES.find { |str| str =~ /bygems/ }
|
@@ -29,9 +34,10 @@ module Autobuild
|
|
29
34
|
end
|
30
35
|
module Subprocess
|
31
36
|
def self.run(name, phase, *cmd)
|
32
|
-
`#{cmd.join(" ")}`
|
37
|
+
output = `#{cmd.join(" ")}`
|
33
38
|
if $?.exitstatus != 0
|
34
39
|
STDERR.puts "ERROR: failed to run #{cmd.join(" ")}"
|
40
|
+
STDERR.puts "ERROR: command output is: #{output}"
|
35
41
|
exit 1
|
36
42
|
end
|
37
43
|
end
|
@@ -82,6 +88,11 @@ module Autoproj
|
|
82
88
|
if File.exists?('/etc/debian_version')
|
83
89
|
codename = File.read('/etc/debian_version').chomp
|
84
90
|
['debian', [codename]]
|
91
|
+
elsif File.exists?('/etc/gentoo-release')
|
92
|
+
release_string = File.read('/etc/gentoo-release').chomp
|
93
|
+
release_string =~ /^.*([^\s]+)$/
|
94
|
+
version = $1
|
95
|
+
['gentoo', [version]]
|
85
96
|
else
|
86
97
|
raise ConfigError, "Unknown operating system"
|
87
98
|
end
|
@@ -115,7 +126,8 @@ module Autoproj
|
|
115
126
|
|
116
127
|
OS_PACKAGE_INSTALL = {
|
117
128
|
'debian' => 'apt-get install -y %s',
|
118
|
-
'ubuntu' => 'apt-get install -y %s'
|
129
|
+
'ubuntu' => 'apt-get install -y %s',
|
130
|
+
'gentoo' => 'emerge --noreplace %s'
|
119
131
|
}
|
120
132
|
|
121
133
|
def generate_os_script(dependencies)
|
@@ -144,6 +156,9 @@ module Autoproj
|
|
144
156
|
end
|
145
157
|
|
146
158
|
data = os_entry.last
|
159
|
+
# This package does not need to be installed on this operating system (example: build tools on Gentoo)
|
160
|
+
next if !data
|
161
|
+
|
147
162
|
if data.kind_of?(Hash)
|
148
163
|
version_entry = data.find do |version_list, data|
|
149
164
|
version_list.to_s.split(',').
|
@@ -265,21 +280,22 @@ DEFS = <<EODEFS
|
|
265
280
|
# The following definitions are needed to bootstrap autoproj
|
266
281
|
ruby:
|
267
282
|
debian,ubuntu:
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
283
|
+
- ruby1.8-dev
|
284
|
+
- ruby1.8
|
285
|
+
- libopenssl-ruby1.8
|
286
|
+
gentoo:
|
287
|
+
- dev-lang/ruby:1.8
|
272
288
|
|
273
289
|
build-essential:
|
274
|
-
debian,ubuntu:
|
275
|
-
|
290
|
+
debian,ubuntu: build-essential
|
291
|
+
gentoo:
|
276
292
|
|
277
293
|
libxml2:
|
278
|
-
debian,ubuntu:
|
279
|
-
|
294
|
+
debian,ubuntu: libxml2-dev
|
295
|
+
gentoo: dev-libs/libxml2
|
280
296
|
libxslt:
|
281
|
-
debian,ubuntu:
|
282
|
-
|
297
|
+
debian,ubuntu: libxslt1-dev
|
298
|
+
gentoo: dev-libs/libxslt
|
283
299
|
|
284
300
|
autobuild: gem
|
285
301
|
autoproj: gem
|
@@ -287,19 +303,25 @@ autoproj: gem
|
|
287
303
|
# The following definitions are for the VCS and build systems
|
288
304
|
git:
|
289
305
|
debian,ubuntu: git-core
|
306
|
+
gentoo: dev-util/git
|
290
307
|
|
291
308
|
svn:
|
292
309
|
debian,ubuntu: svn
|
310
|
+
gentoo: dev-util/subversion
|
293
311
|
|
294
312
|
cmake:
|
295
313
|
debian,ubuntu: cmake
|
314
|
+
gentoo: dev-util/cmake
|
296
315
|
|
297
316
|
autotools:
|
298
317
|
debian,ubuntu: [automake1.9, autoconf]
|
318
|
+
gentoo: [sys-devel/automake:1.9, sys-devel/autoconf]
|
299
319
|
|
300
320
|
lsb_release:
|
301
321
|
debian,ubuntu: lsb-release
|
322
|
+
gentoo: sys-apps/lsb-release
|
302
323
|
|
324
|
+
# vim: expandtab
|
303
325
|
|
304
326
|
|
305
327
|
EODEFS
|
data/lib/autoproj/default.osdeps
CHANGED
@@ -1,21 +1,22 @@
|
|
1
1
|
# The following definitions are needed to bootstrap autoproj
|
2
2
|
ruby:
|
3
3
|
debian,ubuntu:
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
- ruby1.8-dev
|
5
|
+
- ruby1.8
|
6
|
+
- libopenssl-ruby1.8
|
7
|
+
gentoo:
|
8
|
+
- dev-lang/ruby:1.8
|
8
9
|
|
9
10
|
build-essential:
|
10
|
-
debian,ubuntu:
|
11
|
-
|
11
|
+
debian,ubuntu: build-essential
|
12
|
+
gentoo:
|
12
13
|
|
13
14
|
libxml2:
|
14
|
-
debian,ubuntu:
|
15
|
-
|
15
|
+
debian,ubuntu: libxml2-dev
|
16
|
+
gentoo: dev-libs/libxml2
|
16
17
|
libxslt:
|
17
|
-
debian,ubuntu:
|
18
|
-
|
18
|
+
debian,ubuntu: libxslt1-dev
|
19
|
+
gentoo: dev-libs/libxslt
|
19
20
|
|
20
21
|
autobuild: gem
|
21
22
|
autoproj: gem
|
@@ -23,17 +24,23 @@ autoproj: gem
|
|
23
24
|
# The following definitions are for the VCS and build systems
|
24
25
|
git:
|
25
26
|
debian,ubuntu: git-core
|
27
|
+
gentoo: dev-util/git
|
26
28
|
|
27
29
|
svn:
|
28
30
|
debian,ubuntu: svn
|
31
|
+
gentoo: dev-util/subversion
|
29
32
|
|
30
33
|
cmake:
|
31
34
|
debian,ubuntu: cmake
|
35
|
+
gentoo: dev-util/cmake
|
32
36
|
|
33
37
|
autotools:
|
34
38
|
debian,ubuntu: [automake1.9, autoconf]
|
39
|
+
gentoo: [sys-devel/automake:1.9, sys-devel/autoconf]
|
35
40
|
|
36
41
|
lsb_release:
|
37
42
|
debian,ubuntu: lsb-release
|
43
|
+
gentoo: sys-apps/lsb-release
|
38
44
|
|
45
|
+
# vim: expandtab
|
39
46
|
|
data/lib/autoproj/manifest.rb
CHANGED
@@ -313,12 +313,28 @@ module Autoproj
|
|
313
313
|
# type: git
|
314
314
|
# url: blah
|
315
315
|
#
|
316
|
+
# or as
|
317
|
+
# - package_name
|
318
|
+
# type: git
|
319
|
+
# url: blah
|
320
|
+
#
|
316
321
|
# In that case, we should have the package name as
|
317
322
|
# "name => nil". Check that.
|
318
323
|
name, _ = spec.find { |n, v| v.nil? }
|
319
|
-
|
324
|
+
if name
|
325
|
+
spec.delete(name)
|
326
|
+
else
|
327
|
+
name, _ = spec.find { |n, v| n =~ / \w+$/ }
|
328
|
+
name =~ / (\w+)$/
|
329
|
+
spec[$1] = spec.delete(name)
|
330
|
+
name = name.gsub(/ \w+$/, '')
|
331
|
+
end
|
320
332
|
else
|
321
333
|
name, spec = spec.to_a.first
|
334
|
+
if name =~ / (\w+)/
|
335
|
+
spec = { $1 => spec }
|
336
|
+
name = name.gsub(/ \w+$/, '')
|
337
|
+
end
|
322
338
|
end
|
323
339
|
|
324
340
|
if Regexp.new(name) =~ package_name
|
data/lib/autoproj/osdeps.rb
CHANGED
@@ -42,6 +42,11 @@ module Autoproj
|
|
42
42
|
if File.exists?('/etc/debian_version')
|
43
43
|
codename = File.read('/etc/debian_version').chomp
|
44
44
|
['debian', [codename]]
|
45
|
+
elsif File.exists?('/etc/gentoo-release')
|
46
|
+
release_string = File.read('/etc/gentoo-release').chomp
|
47
|
+
release_string =~ /^.*([^\s]+)$/
|
48
|
+
version = $1
|
49
|
+
['gentoo', [version]]
|
45
50
|
else
|
46
51
|
raise ConfigError, "Unknown operating system"
|
47
52
|
end
|
@@ -75,7 +80,8 @@ module Autoproj
|
|
75
80
|
|
76
81
|
OS_PACKAGE_INSTALL = {
|
77
82
|
'debian' => 'apt-get install -y %s',
|
78
|
-
'ubuntu' => 'apt-get install -y %s'
|
83
|
+
'ubuntu' => 'apt-get install -y %s',
|
84
|
+
'gentoo' => 'emerge --noreplace %s'
|
79
85
|
}
|
80
86
|
|
81
87
|
def generate_os_script(dependencies)
|
@@ -104,6 +110,9 @@ module Autoproj
|
|
104
110
|
end
|
105
111
|
|
106
112
|
data = os_entry.last
|
113
|
+
# This package does not need to be installed on this operating system (example: build tools on Gentoo)
|
114
|
+
next if !data
|
115
|
+
|
107
116
|
if data.kind_of?(Hash)
|
108
117
|
version_entry = data.find do |version_list, data|
|
109
118
|
version_list.to_s.split(',').
|
data/lib/autoproj/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: autoproj
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sylvain Joyeux
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-11-09 00:00:00 +01:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|