autoproj 2.8.8 → 2.9.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,26 @@
1
+ module Autoproj
2
+ module RepositoryManagers
3
+ # Base class for all repository managers. Subclasses must add the
4
+ # #install(entries) method
5
+ #
6
+ # Repository managers must be registered in OS_REPOSITORY_MANAGERS
7
+ class Manager
8
+ # @return [Workspace] the workspace
9
+ attr_reader :ws
10
+
11
+ # Create a repository manager
12
+ #
13
+ # @param [Workspace] ws the underlying workspace
14
+ def initialize(ws)
15
+ @ws = ws
16
+ end
17
+
18
+ def install(definitions)
19
+ end
20
+
21
+ def os_dependencies
22
+ []
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,30 @@
1
+ module Autoproj
2
+ module RepositoryManagers
3
+ # Dummy repository manager used for unknown OSes. It simply displays a
4
+ # message to the user when repositories are needed
5
+ class UnknownOSManager < Manager
6
+ def initialize(ws)
7
+ @installed_osrepos = Set.new
8
+ super(ws)
9
+ end
10
+
11
+ def osrepos_interaction_unknown_os
12
+ Autoproj.message 'The build process requires some repositories to be added on our operating system', :bold
13
+ Autoproj.message 'If they are already added, simply ignore this message', :bold
14
+ Autoproj.message 'Press ENTER to continue ', :bold
15
+
16
+ STDIN.readline
17
+ nil
18
+ end
19
+
20
+ def install(osrepos)
21
+ super
22
+ osrepos = osrepos.to_set
23
+ osrepos -= @installed_osrepos
24
+ result = osrepos_interaction_unknown_os unless osrepos.empty?
25
+ @installed_osrepos |= osrepos
26
+ result
27
+ end
28
+ end
29
+ end
30
+ end
@@ -281,6 +281,7 @@ def ws_create(dir = make_tmpdir)
281
281
  dir, os_package_resolver: ws_os_package_resolver,
282
282
  package_managers: ws_package_managers)
283
283
  ws.config.set 'osdeps_mode', 'all'
284
+ ws.config.set 'apt_dpkg_update', true
284
285
  ws.config.set 'GITHUB', 'http,ssh', true
285
286
  ws.config.set 'GITORIOUS', 'http,ssh', true
286
287
  ws.config.set 'gems_install_path', File.join(dir, 'gems')
@@ -1,3 +1,3 @@
1
1
  module Autoproj
2
- VERSION = "2.8.8"
2
+ VERSION = "2.9.0"
3
3
  end
@@ -23,6 +23,8 @@ class Workspace < Ops::Loader
23
23
 
24
24
  attr_reader :loader
25
25
 
26
+ attr_reader :os_repository_resolver
27
+ attr_reader :os_repository_installer
26
28
  attr_reader :os_package_resolver
27
29
  attr_reader :os_package_installer
28
30
 
@@ -51,7 +53,9 @@ class Workspace < Ops::Loader
51
53
 
52
54
  def initialize(root_dir,
53
55
  os_package_resolver: OSPackageResolver.new,
54
- package_managers: OSPackageInstaller::PACKAGE_MANAGERS)
56
+ package_managers: OSPackageInstaller::PACKAGE_MANAGERS,
57
+ os_repository_resolver: OSRepositoryResolver.new(operating_system: os_package_resolver.operating_system),
58
+ os_repository_installer: OSRepositoryInstaller.new(self))
55
59
  @root_dir = root_dir
56
60
  @root_path = Pathname.new(root_dir)
57
61
  @ruby_version_keyword = "ruby#{RUBY_VERSION.split('.')[0, 2].join("")}"
@@ -62,6 +66,8 @@ def initialize(root_dir,
62
66
  env.prepare(root_dir)
63
67
  env.source_before(File.join(dot_autoproj_dir, 'env.sh'))
64
68
 
69
+ @os_repository_resolver = os_repository_resolver
70
+ @os_repository_installer = os_repository_installer
65
71
  @os_package_resolver = os_package_resolver
66
72
  @manifest = Manifest.new(self, os_package_resolver: os_package_resolver)
67
73
  @config = Configuration.new(config_file_path)
@@ -247,6 +253,7 @@ def load_config(reconfigure = false)
247
253
 
248
254
  os_package_resolver.prefer_indep_over_os_packages = config.prefer_indep_over_os_packages?
249
255
  os_package_resolver.operating_system ||= config.get('operating_system', nil)
256
+ os_repository_resolver.operating_system ||= config.get('operating_system', nil)
250
257
  end
251
258
  @config
252
259
  end
@@ -262,6 +269,7 @@ def autodetect_operating_system(force: false)
262
269
  "autodetecting the operating system"
263
270
  names, versions = OSPackageResolver.autodetect_operating_system
264
271
  os_package_resolver.operating_system = [names, versions]
272
+ os_repository_resolver.operating_system = [names, versions]
265
273
  Autobuild.progress :operating_system_autodetection,
266
274
  "operating system: #{(names - ['default']).join(",")} - #{(versions - ['default']).join(",")}"
267
275
  ensure
@@ -287,6 +295,7 @@ def setup_os_package_installer
287
295
  os_package_resolver.load_default
288
296
  os_package_installer.define_osdeps_mode_option
289
297
  os_package_installer.osdeps_mode
298
+ os_package_installer.configure_manager
290
299
  end
291
300
 
292
301
  def setup_ruby_version_handling
@@ -730,10 +739,13 @@ def full_env
730
739
  end
731
740
 
732
741
  # Export the workspace's env.sh file
742
+ #
743
+ # @return [Boolean] true if the environment has been changed, false otherwise
733
744
  def export_env_sh(package_names = nil, shell_helpers: true)
734
745
  full_env = self.full_env
735
- save_cached_env(full_env)
746
+ changed = save_cached_env(full_env)
736
747
  full_env.export_env_sh(shell_helpers: shell_helpers)
748
+ changed
737
749
  end
738
750
 
739
751
  def save_cached_env(env = self.full_env)
@@ -763,11 +775,7 @@ def all_os_packages(import_missing: false, parallel: config.parallel_import_leve
763
775
  retry_count: 0)
764
776
  all_os_packages
765
777
  else
766
- result = Set.new
767
- manifest.all_selected_source_packages.each do |source_package|
768
- result.merge(source_package.autobuild.os_packages)
769
- end
770
- result
778
+ manifest.all_selected_osdep_packages
771
779
  end
772
780
  end
773
781
 
@@ -775,6 +783,12 @@ def install_os_packages(packages, all: all_os_packages, **options)
775
783
  os_package_installer.install(packages, all: all, **options)
776
784
  end
777
785
 
786
+ def install_os_repositories
787
+ return unless os_package_installer.osdeps_mode.include?('os')
788
+
789
+ os_repository_installer.install_os_repositories
790
+ end
791
+
778
792
  # Define and register an autobuild package on this workspace
779
793
  #
780
794
  # @param [Symbol] package_type a package-creation method on {Autobuild},
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: autoproj
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.8
4
+ version: 2.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sylvain Joyeux
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-11-06 00:00:00.000000000 Z
11
+ date: 2019-02-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -366,9 +366,12 @@ files:
366
366
  - lib/autoproj/os_package_installer.rb
367
367
  - lib/autoproj/os_package_query.rb
368
368
  - lib/autoproj/os_package_resolver.rb
369
+ - lib/autoproj/os_repository_installer.rb
370
+ - lib/autoproj/os_repository_resolver.rb
369
371
  - lib/autoproj/package_definition.rb
370
372
  - lib/autoproj/package_managers/apt_dpkg_manager.rb
371
373
  - lib/autoproj/package_managers/bundler_manager.rb
374
+ - lib/autoproj/package_managers/debian_version.rb
372
375
  - lib/autoproj/package_managers/emerge_manager.rb
373
376
  - lib/autoproj/package_managers/gem_manager.rb
374
377
  - lib/autoproj/package_managers/homebrew_manager.rb
@@ -386,6 +389,9 @@ files:
386
389
  - lib/autoproj/package_set.rb
387
390
  - lib/autoproj/query_base.rb
388
391
  - lib/autoproj/reporter.rb
392
+ - lib/autoproj/repository_managers/apt.rb
393
+ - lib/autoproj/repository_managers/manager.rb
394
+ - lib/autoproj/repository_managers/unknown_os_manager.rb
389
395
  - lib/autoproj/shell_completion.rb
390
396
  - lib/autoproj/source_package_query.rb
391
397
  - lib/autoproj/system.rb