autoproj 1.6.2.rc5 → 1.6.2.rc6
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/autoproj +1 -1
- data/lib/autoproj/default.osdeps +8 -5
- data/lib/autoproj/manifest.rb +4 -0
- data/lib/autoproj/osdeps.rb +71 -47
- data/lib/autoproj/version.rb +1 -1
- metadata +3 -15
data/bin/autoproj
CHANGED
data/lib/autoproj/default.osdeps
CHANGED
@@ -15,10 +15,9 @@ ruby18:
|
|
15
15
|
|
16
16
|
ruby19:
|
17
17
|
debian:
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
- rubygems1.9.1
|
18
|
+
- ruby1.9.1
|
19
|
+
- ruby1.9.1-dev
|
20
|
+
- rubygems1.9.1
|
22
21
|
|
23
22
|
ubuntu:
|
24
23
|
- ruby1.9.1
|
@@ -59,7 +58,11 @@ autoproj: gem
|
|
59
58
|
|
60
59
|
# The following definitions are for the VCS and build systems
|
61
60
|
git:
|
62
|
-
debian
|
61
|
+
debian:
|
62
|
+
lenny:
|
63
|
+
git
|
64
|
+
default: git-core
|
65
|
+
ubuntu: git-core
|
63
66
|
gentoo: dev-vcs/git
|
64
67
|
arch: git
|
65
68
|
svn:
|
data/lib/autoproj/manifest.rb
CHANGED
@@ -754,6 +754,10 @@ module Autoproj
|
|
754
754
|
|
755
755
|
# True if calling update_remote_sources will actually do anything
|
756
756
|
def should_update_remote_sources
|
757
|
+
if Autobuild.do_update
|
758
|
+
return true
|
759
|
+
end
|
760
|
+
|
757
761
|
each_remote_source(false) do |source|
|
758
762
|
if !File.directory?(source.local_dir)
|
759
763
|
return true
|
data/lib/autoproj/osdeps.rb
CHANGED
@@ -119,11 +119,11 @@ module Autoproj
|
|
119
119
|
# system on which we are installed
|
120
120
|
def self.supported_operating_system?
|
121
121
|
if @supported_operating_system.nil?
|
122
|
-
|
122
|
+
os_names, _ = operating_system
|
123
123
|
@supported_operating_system =
|
124
|
-
if !
|
124
|
+
if !os_names then false
|
125
125
|
else
|
126
|
-
OS_AUTO_PACKAGE_INSTALL.has_key?(
|
126
|
+
os_names.any? { |os_name| OS_AUTO_PACKAGE_INSTALL.has_key?(os_name) }
|
127
127
|
end
|
128
128
|
end
|
129
129
|
return @supported_operating_system
|
@@ -143,15 +143,21 @@ module Autoproj
|
|
143
143
|
if @operating_system
|
144
144
|
return @operating_system
|
145
145
|
elsif Autoproj.has_config_key?('operating_system')
|
146
|
-
|
146
|
+
os = Autoproj.user_config('operating_system')
|
147
|
+
if !os.respond_to?(:to_ary) # upgrade from previous format
|
148
|
+
@operating_system = nil
|
149
|
+
end
|
147
150
|
end
|
148
151
|
|
149
152
|
Autoproj.progress " autodetecting the operating system"
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
153
|
+
name, versions = os_from_lsb
|
154
|
+
if name
|
155
|
+
if name != "debian"
|
156
|
+
if File.exists?("/etc/debian_version")
|
157
|
+
@operating_system = [[name, "debian"], versions]
|
158
|
+
else
|
159
|
+
@operating_system = [[name], versions]
|
160
|
+
end
|
155
161
|
end
|
156
162
|
end
|
157
163
|
|
@@ -159,18 +165,18 @@ module Autoproj
|
|
159
165
|
# Need to do some heuristics unfortunately
|
160
166
|
@operating_system =
|
161
167
|
if File.exists?('/etc/debian_version')
|
162
|
-
|
163
|
-
if
|
164
|
-
|
168
|
+
codenames = [File.read('/etc/debian_version').strip]
|
169
|
+
if codenames.first =~ /sid/
|
170
|
+
codenames << "unstable" << "sid"
|
165
171
|
end
|
166
|
-
['debian',
|
172
|
+
[['debian'], codenames]
|
167
173
|
elsif File.exists?('/etc/gentoo-release')
|
168
174
|
release_string = File.read('/etc/gentoo-release').strip
|
169
175
|
release_string =~ /^.*([^\s]+)$/
|
170
176
|
version = $1
|
171
|
-
['gentoo', [version]]
|
177
|
+
[['gentoo'], [version]]
|
172
178
|
elsif File.exists?('/etc/arch-release')
|
173
|
-
['arch', []]
|
179
|
+
[['arch'], []]
|
174
180
|
end
|
175
181
|
end
|
176
182
|
|
@@ -180,8 +186,8 @@ module Autoproj
|
|
180
186
|
|
181
187
|
# Normalize the names to lowercase
|
182
188
|
@operating_system =
|
183
|
-
|
184
|
-
@operating_system[1].map(&:downcase)]
|
189
|
+
[@operating_system[0].map(&:downcase),
|
190
|
+
[@operating_system[1].map(&:downcase) + ["default"]]]
|
185
191
|
Autoproj.change_option('operating_system', @operating_system, true)
|
186
192
|
@operating_system
|
187
193
|
end
|
@@ -273,28 +279,30 @@ fi
|
|
273
279
|
# +definition+ is an array of package names that this OS's package
|
274
280
|
# manager can understand
|
275
281
|
def resolve_package(name)
|
276
|
-
|
282
|
+
os_names, os_versions = OSDependencies.operating_system
|
277
283
|
|
278
284
|
dep_def = definitions[name]
|
279
285
|
if !dep_def
|
280
286
|
return NO_PACKAGE
|
281
287
|
end
|
282
288
|
|
283
|
-
if !
|
289
|
+
if !os_names
|
284
290
|
return UNKNOWN_OS
|
285
291
|
end
|
286
292
|
|
287
293
|
# Find a matching entry for the OS name
|
288
|
-
os_entry =
|
289
|
-
|
290
|
-
|
291
|
-
|
294
|
+
os_entry = nil
|
295
|
+
os_names.find do |os_name|
|
296
|
+
os_entry = dep_def.find do |name_list, data|
|
297
|
+
name_list.split(',').
|
298
|
+
map(&:downcase).
|
299
|
+
any? { |n| n == os_name }
|
300
|
+
end
|
292
301
|
end
|
293
302
|
|
294
303
|
if !os_entry
|
295
304
|
return WRONG_OS
|
296
305
|
end
|
297
|
-
|
298
306
|
data = os_entry.last
|
299
307
|
|
300
308
|
# This package does not need to be installed on this operating system (example: build tools on Gentoo)
|
@@ -303,12 +311,17 @@ fi
|
|
303
311
|
end
|
304
312
|
|
305
313
|
if data.kind_of?(Hash)
|
306
|
-
version_entry =
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
314
|
+
version_entry = nil
|
315
|
+
os_versions.each do |os_version|
|
316
|
+
version_entry =
|
317
|
+
data.find do |version_list, data|
|
318
|
+
version_list.to_s.split(',').
|
319
|
+
map(&:downcase).
|
320
|
+
any? do |v|
|
321
|
+
os_version.any? { |osv| Regexp.new(v) =~ osv }
|
322
|
+
end
|
311
323
|
end
|
324
|
+
break if version_entry
|
312
325
|
end
|
313
326
|
|
314
327
|
if !version_entry
|
@@ -319,7 +332,7 @@ fi
|
|
319
332
|
|
320
333
|
if data.respond_to?(:to_ary)
|
321
334
|
return [PACKAGES, data]
|
322
|
-
elsif data.to_str
|
335
|
+
elsif data.respond_to?(:to_str)
|
323
336
|
return [PACKAGES, [data.to_str]]
|
324
337
|
else
|
325
338
|
raise ConfigError, "invalid package specificiation #{data} in #{source_of(name)}"
|
@@ -331,7 +344,7 @@ fi
|
|
331
344
|
#
|
332
345
|
# Raises ConfigError if some packages can't be found
|
333
346
|
def resolve_os_dependencies(dependencies)
|
334
|
-
|
347
|
+
os_names, _ = OSDependencies.operating_system
|
335
348
|
|
336
349
|
os_packages = []
|
337
350
|
dependencies.each do |name|
|
@@ -349,22 +362,30 @@ fi
|
|
349
362
|
end
|
350
363
|
end
|
351
364
|
|
352
|
-
if !OS_AUTO_PACKAGE_INSTALL.has_key?(os_name)
|
353
|
-
raise ConfigError, "I don't know how to install packages on #{
|
365
|
+
if !os_names.any? { |os_name| OS_AUTO_PACKAGE_INSTALL.has_key?(os_name) }
|
366
|
+
raise ConfigError, "I don't know how to install packages on #{os_names.first}"
|
354
367
|
end
|
355
368
|
|
356
369
|
return os_packages
|
357
370
|
end
|
358
371
|
|
359
372
|
|
360
|
-
def generate_user_os_script(
|
361
|
-
|
362
|
-
|
363
|
-
|
373
|
+
def generate_user_os_script(os_names, os_packages)
|
374
|
+
user_package_install = nil
|
375
|
+
os_names.find do |os_name|
|
376
|
+
user_package_install = OS_USER_PACKAGE_INSTALL[os_name]
|
377
|
+
end
|
378
|
+
if user_package_install
|
379
|
+
(user_package_install % [os_packages.join("' '")])
|
380
|
+
else generate_auto_os_script(os_names, os_packages)
|
364
381
|
end
|
365
382
|
end
|
366
|
-
def generate_auto_os_script(
|
367
|
-
|
383
|
+
def generate_auto_os_script(os_names, os_packages)
|
384
|
+
auto_package_install = nil
|
385
|
+
os_names.find do |os_name|
|
386
|
+
auto_package_install = OS_AUTO_PACKAGE_INSTALL[os_name]
|
387
|
+
end
|
388
|
+
(auto_package_install % [os_packages.join("' '")])
|
368
389
|
end
|
369
390
|
|
370
391
|
# Returns true if +name+ is an acceptable OS package for this OS and
|
@@ -458,14 +479,17 @@ fi
|
|
458
479
|
# Returns true if the osdeps system knows how to remove uptodate
|
459
480
|
# packages from the needs-to-be-installed package list on this OS
|
460
481
|
def can_filter_uptodate_packages?
|
461
|
-
|
462
|
-
!!OS_PACKAGE_CHECK[os_name]
|
482
|
+
os_names, _ = OSDependencies.operating_system
|
483
|
+
!!os_names.any? { |os_name| OS_PACKAGE_CHECK[os_name] }
|
463
484
|
end
|
464
485
|
|
465
486
|
# Returns the set of packages in +packages+ that are not already
|
466
487
|
# installed on this OS, if it is supported
|
467
|
-
def filter_uptodate_os_packages(packages,
|
468
|
-
check_method =
|
488
|
+
def filter_uptodate_os_packages(packages, os_names)
|
489
|
+
check_method = nil
|
490
|
+
os_names.find do |os_name|
|
491
|
+
check_method = OS_PACKAGE_CHECK[os_name]
|
492
|
+
end
|
469
493
|
return packages.dup if !check_method
|
470
494
|
|
471
495
|
packages.find_all { |pkg| !check_method[pkg] }
|
@@ -752,10 +776,10 @@ with the corresponding option (--all, --ruby, --os or --none).
|
|
752
776
|
|
753
777
|
osdeps, gems = partition_packages(packages, package_osdeps)
|
754
778
|
if handled_os
|
755
|
-
|
779
|
+
os_names, os_versions = OSDependencies.operating_system
|
756
780
|
os_packages = resolve_os_dependencies(osdeps)
|
757
781
|
if filter_uptodate_packages
|
758
|
-
os_packages = filter_uptodate_os_packages(os_packages,
|
782
|
+
os_packages = filter_uptodate_os_packages(os_packages, os_names)
|
759
783
|
end
|
760
784
|
end
|
761
785
|
if filter_uptodate_packages
|
@@ -766,8 +790,8 @@ with the corresponding option (--all, --ruby, --os or --none).
|
|
766
790
|
|
767
791
|
if !osdeps.empty? && (!os_packages || !os_packages.empty?)
|
768
792
|
if handled_os
|
769
|
-
shell_script = generate_auto_os_script(
|
770
|
-
user_shell_script = generate_user_os_script(
|
793
|
+
shell_script = generate_auto_os_script(os_names, os_packages)
|
794
|
+
user_shell_script = generate_user_os_script(os_names, os_packages)
|
771
795
|
end
|
772
796
|
if osdeps_interaction(osdeps, os_packages, user_shell_script, silent?)
|
773
797
|
Autoproj.progress " installing OS packages: #{os_packages.sort.join(", ")}"
|
data/lib/autoproj/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: autoproj
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash: 977940578
|
5
4
|
prerelease: true
|
6
5
|
segments:
|
7
6
|
- 1
|
8
7
|
- 6
|
9
8
|
- 2
|
10
|
-
-
|
11
|
-
version: 1.6.2.
|
9
|
+
- rc6
|
10
|
+
version: 1.6.2.rc6
|
12
11
|
platform: ruby
|
13
12
|
authors:
|
14
13
|
- Sylvain Joyeux
|
@@ -16,7 +15,7 @@ autorequire:
|
|
16
15
|
bindir: bin
|
17
16
|
cert_chain: []
|
18
17
|
|
19
|
-
date: 2010-10-
|
18
|
+
date: 2010-10-26 00:00:00 +02:00
|
20
19
|
default_executable:
|
21
20
|
dependencies:
|
22
21
|
- !ruby/object:Gem::Dependency
|
@@ -27,7 +26,6 @@ dependencies:
|
|
27
26
|
requirements:
|
28
27
|
- - ">="
|
29
28
|
- !ruby/object:Gem::Version
|
30
|
-
hash: 17
|
31
29
|
segments:
|
32
30
|
- 1
|
33
31
|
- 5
|
@@ -43,7 +41,6 @@ dependencies:
|
|
43
41
|
requirements:
|
44
42
|
- - ">="
|
45
43
|
- !ruby/object:Gem::Version
|
46
|
-
hash: 23
|
47
44
|
segments:
|
48
45
|
- 1
|
49
46
|
- 0
|
@@ -59,7 +56,6 @@ dependencies:
|
|
59
56
|
requirements:
|
60
57
|
- - ">="
|
61
58
|
- !ruby/object:Gem::Version
|
62
|
-
hash: 29
|
63
59
|
segments:
|
64
60
|
- 1
|
65
61
|
- 3
|
@@ -75,7 +71,6 @@ dependencies:
|
|
75
71
|
requirements:
|
76
72
|
- - ">="
|
77
73
|
- !ruby/object:Gem::Version
|
78
|
-
hash: 29
|
79
74
|
segments:
|
80
75
|
- 1
|
81
76
|
- 3
|
@@ -91,7 +86,6 @@ dependencies:
|
|
91
86
|
requirements:
|
92
87
|
- - ">="
|
93
88
|
- !ruby/object:Gem::Version
|
94
|
-
hash: 3
|
95
89
|
segments:
|
96
90
|
- 1
|
97
91
|
- 5
|
@@ -107,7 +101,6 @@ dependencies:
|
|
107
101
|
requirements:
|
108
102
|
- - ">="
|
109
103
|
- !ruby/object:Gem::Version
|
110
|
-
hash: 7
|
111
104
|
segments:
|
112
105
|
- 2
|
113
106
|
- 0
|
@@ -123,7 +116,6 @@ dependencies:
|
|
123
116
|
requirements:
|
124
117
|
- - ">="
|
125
118
|
- !ruby/object:Gem::Version
|
126
|
-
hash: 25
|
127
119
|
segments:
|
128
120
|
- 0
|
129
121
|
- 5
|
@@ -139,7 +131,6 @@ dependencies:
|
|
139
131
|
requirements:
|
140
132
|
- - ">="
|
141
133
|
- !ruby/object:Gem::Version
|
142
|
-
hash: 31
|
143
134
|
segments:
|
144
135
|
- 2
|
145
136
|
- 4
|
@@ -155,7 +146,6 @@ dependencies:
|
|
155
146
|
requirements:
|
156
147
|
- - ">="
|
157
148
|
- !ruby/object:Gem::Version
|
158
|
-
hash: 19
|
159
149
|
segments:
|
160
150
|
- 2
|
161
151
|
- 6
|
@@ -267,7 +257,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
267
257
|
requirements:
|
268
258
|
- - ">="
|
269
259
|
- !ruby/object:Gem::Version
|
270
|
-
hash: 3
|
271
260
|
segments:
|
272
261
|
- 0
|
273
262
|
version: "0"
|
@@ -276,7 +265,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
276
265
|
requirements:
|
277
266
|
- - ">"
|
278
267
|
- !ruby/object:Gem::Version
|
279
|
-
hash: 25
|
280
268
|
segments:
|
281
269
|
- 1
|
282
270
|
- 3
|