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 CHANGED
@@ -68,7 +68,7 @@ where
68
68
  'vcs_options' are optional values that can be given to the chosen VCS
69
69
  EOTEXT
70
70
  end
71
- raise e
71
+ raise
72
72
  end
73
73
 
74
74
  # Expand directories in the selected_packages set, before we chdir to the
@@ -15,10 +15,9 @@ ruby18:
15
15
 
16
16
  ruby19:
17
17
  debian:
18
- stable,squeeze,sid:
19
- - ruby1.9.1
20
- - ruby1.9.1-dev
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,ubuntu: git-core
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:
@@ -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
@@ -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
- osdef = operating_system
122
+ os_names, _ = operating_system
123
123
  @supported_operating_system =
124
- if !osdef then false
124
+ if !os_names then false
125
125
  else
126
- OS_AUTO_PACKAGE_INSTALL.has_key?(osdef[0])
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
- return (@operating_system = Autoproj.user_config('operating_system'))
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
- if data = os_from_lsb
151
- if data[0] != "debian"
152
- # if on Debian proper, fall back to reading debian_version,
153
- # as sid is listed as lenny by lsb-release
154
- @operating_system = data
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
- codename = [File.read('/etc/debian_version').strip]
163
- if codename.first =~ /sid/
164
- codename << "unstable" << "sid"
168
+ codenames = [File.read('/etc/debian_version').strip]
169
+ if codenames.first =~ /sid/
170
+ codenames << "unstable" << "sid"
165
171
  end
166
- ['debian', codename]
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
- [@operating_system[0].downcase,
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
- os_name, os_version = OSDependencies.operating_system
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 !os_name
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 = dep_def.find do |name_list, data|
289
- name_list.split(',').
290
- map(&:downcase).
291
- any? { |n| n == os_name }
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 = data.find do |version_list, data|
307
- version_list.to_s.split(',').
308
- map(&:downcase).
309
- any? do |v|
310
- os_version.any? { |osv| Regexp.new(v) =~ osv }
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 =~ /\w+/
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
- os_name, os_version = OSDependencies.operating_system
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 #{os_name}"
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(os_name, os_packages)
361
- if OS_USER_PACKAGE_INSTALL[os_name]
362
- (OS_USER_PACKAGE_INSTALL[os_name] % [os_packages.join("' '")])
363
- else generate_auto_os_script(os_name, os_packages)
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(os_name, os_packages)
367
- (OS_AUTO_PACKAGE_INSTALL[os_name] % [os_packages.join("' '")])
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
- os_name, _ = OSDependencies.operating_system
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, os_name)
468
- check_method = OS_PACKAGE_CHECK[os_name]
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
- os_name, os_version = OSDependencies.operating_system
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, os_name)
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(os_name, os_packages)
770
- user_shell_script = generate_user_os_script(os_name, os_packages)
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(", ")}"
@@ -1,3 +1,3 @@
1
1
  module Autoproj
2
- VERSION = "1.6.2.rc5"
2
+ VERSION = "1.6.2.rc6"
3
3
  end
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
- - rc5
11
- version: 1.6.2.rc5
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-21 00:00:00 +02:00
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