autoproj 1.7.21.b2 → 1.7.21.b3
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/bin/autoproj +1 -1
- data/bin/autoproj_bootstrap +28 -17
- data/lib/autoproj/cmdline.rb +5 -2
- data/lib/autoproj/default.osdeps +3 -3
- data/lib/autoproj/manifest.rb +1 -1
- data/lib/autoproj/osdeps.rb +23 -12
- data/lib/autoproj/version.rb +1 -1
- data/test/test_os_dependencies.rb +14 -0
- metadata +5 -5
data/Rakefile
CHANGED
@@ -7,7 +7,7 @@ Utilrb::Rake.hoe do
|
|
7
7
|
Hoe.spec 'autoproj' do
|
8
8
|
self.developer "Sylvain Joyeux", "sylvain.joyeux@dfki.de"
|
9
9
|
|
10
|
-
self.url = ["http://rock-robotics.org/autoproj",
|
10
|
+
self.url = ["http://rock-robotics.org/documentation/autoproj",
|
11
11
|
"git://github.com/doudou/autoproj.git"]
|
12
12
|
self.rubyforge_name = 'autobuild'
|
13
13
|
self.summary = 'Easy installation and management of software packages'
|
data/bin/autoproj
CHANGED
data/bin/autoproj_bootstrap
CHANGED
@@ -188,6 +188,9 @@ fi
|
|
188
188
|
attr_writer :needs_locking
|
189
189
|
def needs_locking?; !!@needs_locking end
|
190
190
|
|
191
|
+
attr_reader :auto_install_cmd
|
192
|
+
attr_reader :user_install_cmd
|
193
|
+
|
191
194
|
def initialize(names, needs_locking, user_install_cmd, auto_install_cmd)
|
192
195
|
super(names)
|
193
196
|
@needs_locking, @user_install_cmd, @auto_install_cmd =
|
@@ -205,7 +208,7 @@ fi
|
|
205
208
|
(auto_install_cmd % [os_packages.join("' '")])
|
206
209
|
end
|
207
210
|
|
208
|
-
def osdeps_interaction(
|
211
|
+
def osdeps_interaction(os_packages, shell_script)
|
209
212
|
if OSDependencies.force_osdeps
|
210
213
|
return true
|
211
214
|
elsif enabled?
|
@@ -242,11 +245,11 @@ fi
|
|
242
245
|
def install(packages)
|
243
246
|
handled_os = OSDependencies.supported_operating_system?
|
244
247
|
if handled_os
|
245
|
-
shell_script = generate_auto_os_script(
|
246
|
-
user_shell_script = generate_user_os_script(
|
248
|
+
shell_script = generate_auto_os_script(packages)
|
249
|
+
user_shell_script = generate_user_os_script(packages)
|
247
250
|
end
|
248
|
-
if osdeps_interaction(
|
249
|
-
Autoproj.message " installing OS packages: #{
|
251
|
+
if osdeps_interaction(packages, user_shell_script)
|
252
|
+
Autoproj.message " installing OS packages: #{packages.sort.join(", ")}"
|
250
253
|
|
251
254
|
if Autoproj.verbose
|
252
255
|
Autoproj.message "Generating installation script for non-ruby OS dependencies"
|
@@ -331,7 +334,7 @@ fi
|
|
331
334
|
|
332
335
|
def gem_fetcher
|
333
336
|
if !@gem_fetcher
|
334
|
-
Autoproj.message "looking for RubyGems updates"
|
337
|
+
Autoproj.message " looking for RubyGems updates"
|
335
338
|
@gem_fetcher = Gem::SpecFetcher.fetcher
|
336
339
|
end
|
337
340
|
@gem_fetcher
|
@@ -372,7 +375,7 @@ fi
|
|
372
375
|
end
|
373
376
|
|
374
377
|
if gems_interaction(gems, cmdlines)
|
375
|
-
Autoproj.message "installing/updating RubyGems dependencies: #{gems.map { |g| g.join(" ") }.sort.join(", ")}"
|
378
|
+
Autoproj.message " installing/updating RubyGems dependencies: #{gems.map { |g| g.join(" ") }.sort.join(", ")}"
|
376
379
|
|
377
380
|
cmdlines.each do |c|
|
378
381
|
Autobuild::Subprocess.run 'autoproj', 'osdeps', *c
|
@@ -528,6 +531,7 @@ fi
|
|
528
531
|
self.alias(ruby_version_keyword, "ruby")
|
529
532
|
end
|
530
533
|
self.suffixes << ruby_version_keyword
|
534
|
+
autodetect_ruby
|
531
535
|
|
532
536
|
AUTOPROJ_OSDEPS = File.join(File.expand_path(File.dirname(__FILE__)), 'default.osdeps')
|
533
537
|
def self.load_default
|
@@ -639,17 +643,20 @@ fi
|
|
639
643
|
end
|
640
644
|
|
641
645
|
# Perform some sanity checks on the given osdeps definitions
|
642
|
-
def self.verify_definitions(hash)
|
646
|
+
def self.verify_definitions(hash, path = [])
|
643
647
|
hash.each do |key, value|
|
644
|
-
if !key.kind_of?(String)
|
645
|
-
raise ArgumentError, "invalid osdeps definition: found an #{key.class}. Don't forget to put quotes around numbers"
|
648
|
+
if value && !key.kind_of?(String)
|
649
|
+
raise ArgumentError, "invalid osdeps definition: found an #{key.class} as a key in #{path.join("/")}. Don't forget to put quotes around numbers"
|
650
|
+
elsif !value && (key.kind_of?(Hash) || key.kind_of?(Array))
|
651
|
+
verify_definitions(key)
|
646
652
|
end
|
647
653
|
next if !value
|
654
|
+
|
648
655
|
if value.kind_of?(Array) || value.kind_of?(Hash)
|
649
|
-
verify_definitions(value)
|
656
|
+
verify_definitions(value, (path + [key]))
|
650
657
|
else
|
651
658
|
if !value.kind_of?(String)
|
652
|
-
raise ArgumentError, "invalid osdeps definition: found an #{value.class}. Don't forget to put quotes around numbers"
|
659
|
+
raise ArgumentError, "invalid osdeps definition: found an #{value.class} as a value in #{path.join("/")}. Don't forget to put quotes around numbers"
|
653
660
|
end
|
654
661
|
end
|
655
662
|
end
|
@@ -799,6 +806,10 @@ fi
|
|
799
806
|
# name and version. The package list might be empty even if status ==
|
800
807
|
# FOUND_PACKAGES, for instance if the ignore keyword is used.
|
801
808
|
def resolve_package(name)
|
809
|
+
while OSDependencies.aliases.has_key?(name)
|
810
|
+
name = OSDependencies.aliases[name]
|
811
|
+
end
|
812
|
+
|
802
813
|
os_names, os_versions = OSDependencies.operating_system
|
803
814
|
|
804
815
|
dep_def = definitions[name]
|
@@ -1724,7 +1735,7 @@ archive:
|
|
1724
1735
|
- tar
|
1725
1736
|
- unzip
|
1726
1737
|
lsb_release:
|
1727
|
-
arch:
|
1738
|
+
arch: ignore
|
1728
1739
|
gentoo: sys-apps/lsb-release
|
1729
1740
|
debian,ubuntu: lsb-release
|
1730
1741
|
ruby18:
|
@@ -1769,8 +1780,8 @@ cmake:
|
|
1769
1780
|
gentoo: dev-util/cmake
|
1770
1781
|
debian,ubuntu: cmake
|
1771
1782
|
build-essential:
|
1772
|
-
arch:
|
1773
|
-
gentoo:
|
1783
|
+
arch: ignore
|
1784
|
+
gentoo: ignore
|
1774
1785
|
debian,ubuntu: build-essential
|
1775
1786
|
libxslt:
|
1776
1787
|
arch: libxslt
|
@@ -1834,7 +1845,7 @@ end
|
|
1834
1845
|
# run autoproj bootstrap manually.
|
1835
1846
|
if ARGV.first != "localdev"
|
1836
1847
|
if ARGV.first == "dev"
|
1837
|
-
Autoproj::
|
1848
|
+
Autoproj::PackageManagers::GemManager.with_prerelease = true
|
1838
1849
|
ARGV.shift
|
1839
1850
|
end
|
1840
1851
|
begin
|
@@ -1844,7 +1855,7 @@ if ARGV.first != "localdev"
|
|
1844
1855
|
STDERR.puts "failed: #{e.message}"
|
1845
1856
|
exit(1)
|
1846
1857
|
end
|
1847
|
-
Autoproj::
|
1858
|
+
Autoproj::PackageManagers::GemManager.with_prerelease = false
|
1848
1859
|
|
1849
1860
|
if !system('autoproj', 'bootstrap', *ARGV)
|
1850
1861
|
STDERR.puts "ERROR: failed to run autoproj bootstrap #{ARGV.join(", ")}"
|
data/lib/autoproj/cmdline.rb
CHANGED
@@ -1,10 +1,13 @@
|
|
1
1
|
require 'highline'
|
2
|
-
require 'utilrb/module/attr_predicate'
|
3
2
|
module Autoproj
|
4
3
|
class << self
|
5
4
|
attr_accessor :verbose
|
6
5
|
attr_reader :console
|
7
|
-
|
6
|
+
|
7
|
+
def silent?
|
8
|
+
!!@silent
|
9
|
+
end
|
10
|
+
attr_writer :silent=
|
8
11
|
end
|
9
12
|
@silent = false
|
10
13
|
@verbose = false
|
data/lib/autoproj/default.osdeps
CHANGED
@@ -36,8 +36,8 @@ ruby19:
|
|
36
36
|
|
37
37
|
build-essential:
|
38
38
|
debian,ubuntu: build-essential
|
39
|
-
gentoo:
|
40
|
-
arch:
|
39
|
+
gentoo: ignore
|
40
|
+
arch: ignore
|
41
41
|
|
42
42
|
libxml2:
|
43
43
|
debian,ubuntu: libxml2-dev
|
@@ -82,7 +82,7 @@ autotools:
|
|
82
82
|
lsb_release:
|
83
83
|
debian,ubuntu: lsb-release
|
84
84
|
gentoo: sys-apps/lsb-release
|
85
|
-
arch:
|
85
|
+
arch: ignore
|
86
86
|
|
87
87
|
archive:
|
88
88
|
debian,ubuntu: [tar, unzip]
|
data/lib/autoproj/manifest.rb
CHANGED
@@ -2098,7 +2098,7 @@ module Autoproj
|
|
2098
2098
|
match_pkg_name = Regexp.new(Regexp.quote(sel))
|
2099
2099
|
all_packages.each do |pkg_name|
|
2100
2100
|
pkg = Autobuild::Package[pkg_name]
|
2101
|
-
if pkg_name =~ match_pkg_name || sel =~ Regexp.new("^#{Regexp.quote(pkg.srcdir)}") || pkg.srcdir =~ Regexp.new("^#{Regexp.quote(sel)}")
|
2101
|
+
if pkg_name =~ match_pkg_name || "#{sel}/" =~ Regexp.new("^#{Regexp.quote(pkg.srcdir)}/") || pkg.srcdir =~ Regexp.new("^#{Regexp.quote(sel)}")
|
2102
2102
|
# Check-out packages that are not in the manifest only
|
2103
2103
|
# if they are explicitely selected
|
2104
2104
|
if !all_layout_packages.include?(pkg.name)
|
data/lib/autoproj/osdeps.rb
CHANGED
@@ -89,6 +89,9 @@ fi
|
|
89
89
|
attr_writer :needs_locking
|
90
90
|
def needs_locking?; !!@needs_locking end
|
91
91
|
|
92
|
+
attr_reader :auto_install_cmd
|
93
|
+
attr_reader :user_install_cmd
|
94
|
+
|
92
95
|
def initialize(names, needs_locking, user_install_cmd, auto_install_cmd)
|
93
96
|
super(names)
|
94
97
|
@needs_locking, @user_install_cmd, @auto_install_cmd =
|
@@ -106,7 +109,7 @@ fi
|
|
106
109
|
(auto_install_cmd % [os_packages.join("' '")])
|
107
110
|
end
|
108
111
|
|
109
|
-
def osdeps_interaction(
|
112
|
+
def osdeps_interaction(os_packages, shell_script)
|
110
113
|
if OSDependencies.force_osdeps
|
111
114
|
return true
|
112
115
|
elsif enabled?
|
@@ -143,11 +146,11 @@ fi
|
|
143
146
|
def install(packages)
|
144
147
|
handled_os = OSDependencies.supported_operating_system?
|
145
148
|
if handled_os
|
146
|
-
shell_script = generate_auto_os_script(
|
147
|
-
user_shell_script = generate_user_os_script(
|
149
|
+
shell_script = generate_auto_os_script(packages)
|
150
|
+
user_shell_script = generate_user_os_script(packages)
|
148
151
|
end
|
149
|
-
if osdeps_interaction(
|
150
|
-
Autoproj.message " installing OS packages: #{
|
152
|
+
if osdeps_interaction(packages, user_shell_script)
|
153
|
+
Autoproj.message " installing OS packages: #{packages.sort.join(", ")}"
|
151
154
|
|
152
155
|
if Autoproj.verbose
|
153
156
|
Autoproj.message "Generating installation script for non-ruby OS dependencies"
|
@@ -232,7 +235,7 @@ fi
|
|
232
235
|
|
233
236
|
def gem_fetcher
|
234
237
|
if !@gem_fetcher
|
235
|
-
Autoproj.message "looking for RubyGems updates"
|
238
|
+
Autoproj.message " looking for RubyGems updates"
|
236
239
|
@gem_fetcher = Gem::SpecFetcher.fetcher
|
237
240
|
end
|
238
241
|
@gem_fetcher
|
@@ -273,7 +276,7 @@ fi
|
|
273
276
|
end
|
274
277
|
|
275
278
|
if gems_interaction(gems, cmdlines)
|
276
|
-
Autoproj.message "installing/updating RubyGems dependencies: #{gems.map { |g| g.join(" ") }.sort.join(", ")}"
|
279
|
+
Autoproj.message " installing/updating RubyGems dependencies: #{gems.map { |g| g.join(" ") }.sort.join(", ")}"
|
277
280
|
|
278
281
|
cmdlines.each do |c|
|
279
282
|
Autobuild::Subprocess.run 'autoproj', 'osdeps', *c
|
@@ -429,6 +432,7 @@ fi
|
|
429
432
|
self.alias(ruby_version_keyword, "ruby")
|
430
433
|
end
|
431
434
|
self.suffixes << ruby_version_keyword
|
435
|
+
autodetect_ruby
|
432
436
|
|
433
437
|
AUTOPROJ_OSDEPS = File.join(File.expand_path(File.dirname(__FILE__)), 'default.osdeps')
|
434
438
|
def self.load_default
|
@@ -540,17 +544,20 @@ fi
|
|
540
544
|
end
|
541
545
|
|
542
546
|
# Perform some sanity checks on the given osdeps definitions
|
543
|
-
def self.verify_definitions(hash)
|
547
|
+
def self.verify_definitions(hash, path = [])
|
544
548
|
hash.each do |key, value|
|
545
|
-
if !key.kind_of?(String)
|
546
|
-
raise ArgumentError, "invalid osdeps definition: found an #{key.class}. Don't forget to put quotes around numbers"
|
549
|
+
if value && !key.kind_of?(String)
|
550
|
+
raise ArgumentError, "invalid osdeps definition: found an #{key.class} as a key in #{path.join("/")}. Don't forget to put quotes around numbers"
|
551
|
+
elsif !value && (key.kind_of?(Hash) || key.kind_of?(Array))
|
552
|
+
verify_definitions(key)
|
547
553
|
end
|
548
554
|
next if !value
|
555
|
+
|
549
556
|
if value.kind_of?(Array) || value.kind_of?(Hash)
|
550
|
-
verify_definitions(value)
|
557
|
+
verify_definitions(value, (path + [key]))
|
551
558
|
else
|
552
559
|
if !value.kind_of?(String)
|
553
|
-
raise ArgumentError, "invalid osdeps definition: found an #{value.class}. Don't forget to put quotes around numbers"
|
560
|
+
raise ArgumentError, "invalid osdeps definition: found an #{value.class} as a value in #{path.join("/")}. Don't forget to put quotes around numbers"
|
554
561
|
end
|
555
562
|
end
|
556
563
|
end
|
@@ -700,6 +707,10 @@ fi
|
|
700
707
|
# name and version. The package list might be empty even if status ==
|
701
708
|
# FOUND_PACKAGES, for instance if the ignore keyword is used.
|
702
709
|
def resolve_package(name)
|
710
|
+
while OSDependencies.aliases.has_key?(name)
|
711
|
+
name = OSDependencies.aliases[name]
|
712
|
+
end
|
713
|
+
|
703
714
|
os_names, os_versions = OSDependencies.operating_system
|
704
715
|
|
705
716
|
dep_def = definitions[name]
|
data/lib/autoproj/version.rb
CHANGED
@@ -50,6 +50,20 @@ class TC_OSDependencies < Test::Unit::TestCase
|
|
50
50
|
assert_equal expected, osdeps.resolve_package('pkg')
|
51
51
|
end
|
52
52
|
|
53
|
+
def test_resolve_package_applies_aliases
|
54
|
+
data = { 'pkg' => {
|
55
|
+
'test' => {
|
56
|
+
'v1.0' => 'pkg1.0',
|
57
|
+
'v1.1' => 'pkg1.1',
|
58
|
+
'default' => 'pkgdef'
|
59
|
+
}
|
60
|
+
} }
|
61
|
+
Autoproj::OSDependencies.alias('pkg', 'bla')
|
62
|
+
osdeps = create_osdep(data)
|
63
|
+
expected = [[osdeps.os_package_handler, FOUND_PACKAGES, ['pkg1.0']]]
|
64
|
+
assert_equal expected, osdeps.resolve_package('bla')
|
65
|
+
end
|
66
|
+
|
53
67
|
def test_resolve_specific_os_name_and_version_single_package
|
54
68
|
data = { 'pkg' => {
|
55
69
|
'test' => {
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: autoproj
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 137
|
5
5
|
prerelease: 7
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 7
|
9
9
|
- 21
|
10
10
|
- b
|
11
|
-
-
|
12
|
-
version: 1.7.21.
|
11
|
+
- 3
|
12
|
+
version: 1.7.21.b3
|
13
13
|
platform: ruby
|
14
14
|
authors:
|
15
15
|
- Sylvain Joyeux
|
@@ -17,7 +17,7 @@ autorequire:
|
|
17
17
|
bindir: bin
|
18
18
|
cert_chain: []
|
19
19
|
|
20
|
-
date: 2012-03-
|
20
|
+
date: 2012-03-30 00:00:00 Z
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
23
23
|
name: autobuild
|
@@ -169,7 +169,7 @@ files:
|
|
169
169
|
- test/package_managers/test_gem.rb
|
170
170
|
- test/test_package_manifest.rb
|
171
171
|
- .gemtest
|
172
|
-
homepage: http://rock-robotics.org/autoproj
|
172
|
+
homepage: http://rock-robotics.org/documentation/autoproj
|
173
173
|
licenses: []
|
174
174
|
|
175
175
|
post_install_message:
|