autoproj 2.12.0 → 2.15.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/lint.yml +25 -0
- data/.github/workflows/test.yml +30 -0
- data/.rubocop.yml +79 -91
- data/.rubocop_todo.yml +1473 -0
- data/Gemfile +9 -9
- data/Rakefile +24 -24
- data/autoproj.gemspec +22 -22
- data/bin/alocate +4 -4
- data/bin/alog +6 -7
- data/bin/amake +4 -4
- data/bin/aup +4 -4
- data/bin/autoproj +2 -2
- data/bin/autoproj_bootstrap +186 -183
- data/bin/autoproj_bootstrap.in +7 -8
- data/bin/autoproj_install +185 -182
- data/bin/autoproj_install.in +6 -7
- data/lib/autoproj/aruba_minitest.rb +6 -11
- data/lib/autoproj/autobuild.rb +5 -6
- data/lib/autoproj/autobuild_extensions/archive_importer.rb +10 -11
- data/lib/autoproj/autobuild_extensions/dsl.rb +61 -44
- data/lib/autoproj/autobuild_extensions/git.rb +27 -26
- data/lib/autoproj/autobuild_extensions/package.rb +23 -22
- data/lib/autoproj/autobuild_extensions/svn.rb +1 -2
- data/lib/autoproj/base.rb +1 -1
- data/lib/autoproj/bash_completion.rb +5 -6
- data/lib/autoproj/build_option.rb +22 -24
- data/lib/autoproj/cli/base.rb +27 -27
- data/lib/autoproj/cli/bootstrap.rb +14 -16
- data/lib/autoproj/cli/build.rb +18 -10
- data/lib/autoproj/cli/cache.rb +51 -8
- data/lib/autoproj/cli/clean.rb +10 -10
- data/lib/autoproj/cli/commit.rb +7 -8
- data/lib/autoproj/cli/doc.rb +2 -2
- data/lib/autoproj/cli/envsh.rb +1 -2
- data/lib/autoproj/cli/exec.rb +60 -20
- data/lib/autoproj/cli/inspection_tool.rb +18 -13
- data/lib/autoproj/cli/locate.rb +30 -41
- data/lib/autoproj/cli/log.rb +7 -7
- data/lib/autoproj/cli/main.rb +217 -205
- data/lib/autoproj/cli/main_doc.rb +22 -21
- data/lib/autoproj/cli/main_global.rb +44 -19
- data/lib/autoproj/cli/main_plugin.rb +18 -18
- data/lib/autoproj/cli/main_test.rb +28 -27
- data/lib/autoproj/cli/manifest.rb +7 -7
- data/lib/autoproj/cli/osdeps.rb +12 -11
- data/lib/autoproj/cli/patcher.rb +2 -3
- data/lib/autoproj/cli/query.rb +17 -18
- data/lib/autoproj/cli/reconfigure.rb +1 -2
- data/lib/autoproj/cli/reset.rb +9 -12
- data/lib/autoproj/cli/show.rb +48 -55
- data/lib/autoproj/cli/status.rb +56 -44
- data/lib/autoproj/cli/switch_config.rb +5 -6
- data/lib/autoproj/cli/tag.rb +12 -11
- data/lib/autoproj/cli/test.rb +7 -7
- data/lib/autoproj/cli/update.rb +104 -51
- data/lib/autoproj/cli/utility.rb +14 -12
- data/lib/autoproj/cli/version.rb +42 -40
- data/lib/autoproj/cli/versions.rb +14 -15
- data/lib/autoproj/cli/watch.rb +33 -37
- data/lib/autoproj/cli/which.rb +16 -20
- data/lib/autoproj/cli.rb +4 -2
- data/lib/autoproj/configuration.rb +78 -85
- data/lib/autoproj/default.osdeps +29 -3
- data/lib/autoproj/environment.rb +42 -23
- data/lib/autoproj/exceptions.rb +9 -3
- data/lib/autoproj/find_workspace.rb +20 -25
- data/lib/autoproj/git_server_configuration.rb +40 -44
- data/lib/autoproj/gitorious.rb +1 -1
- data/lib/autoproj/installation_manifest.rb +64 -29
- data/lib/autoproj/local_package_set.rb +13 -11
- data/lib/autoproj/manifest.rb +145 -135
- data/lib/autoproj/metapackage.rb +2 -6
- data/lib/autoproj/ops/atomic_write.rb +7 -6
- data/lib/autoproj/ops/build.rb +4 -6
- data/lib/autoproj/ops/cache.rb +64 -53
- data/lib/autoproj/ops/cached_env.rb +7 -6
- data/lib/autoproj/ops/configuration.rb +511 -506
- data/lib/autoproj/ops/import.rb +90 -61
- data/lib/autoproj/ops/install.rb +179 -175
- data/lib/autoproj/ops/loader.rb +77 -76
- data/lib/autoproj/ops/main_config_switcher.rb +36 -45
- data/lib/autoproj/ops/phase_reporting.rb +4 -4
- data/lib/autoproj/ops/snapshot.rb +250 -247
- data/lib/autoproj/ops/tools.rb +76 -78
- data/lib/autoproj/ops/watch.rb +6 -6
- data/lib/autoproj/ops/which.rb +17 -14
- data/lib/autoproj/options.rb +13 -2
- data/lib/autoproj/os_package_installer.rb +102 -92
- data/lib/autoproj/os_package_query.rb +7 -13
- data/lib/autoproj/os_package_resolver.rb +189 -140
- data/lib/autoproj/os_repository_installer.rb +4 -4
- data/lib/autoproj/os_repository_resolver.rb +8 -6
- data/lib/autoproj/package_definition.rb +12 -13
- data/lib/autoproj/package_managers/apt_dpkg_manager.rb +46 -31
- data/lib/autoproj/package_managers/bundler_manager.rb +156 -118
- data/lib/autoproj/package_managers/debian_version.rb +25 -21
- data/lib/autoproj/package_managers/emerge_manager.rb +2 -3
- data/lib/autoproj/package_managers/gem_manager.rb +68 -77
- data/lib/autoproj/package_managers/homebrew_manager.rb +3 -4
- data/lib/autoproj/package_managers/manager.rb +8 -3
- data/lib/autoproj/package_managers/pacman_manager.rb +2 -3
- data/lib/autoproj/package_managers/pip_manager.rb +37 -27
- data/lib/autoproj/package_managers/pkg_manager.rb +3 -4
- data/lib/autoproj/package_managers/port_manager.rb +2 -3
- data/lib/autoproj/package_managers/shell_script_manager.rb +66 -36
- data/lib/autoproj/package_managers/unknown_os_manager.rb +5 -8
- data/lib/autoproj/package_managers/yum_manager.rb +12 -15
- data/lib/autoproj/package_managers/zypper_manager.rb +11 -14
- data/lib/autoproj/package_manifest.rb +66 -53
- data/lib/autoproj/package_selection.rb +187 -187
- data/lib/autoproj/package_set.rb +128 -114
- data/lib/autoproj/python.rb +285 -0
- data/lib/autoproj/query_base.rb +20 -14
- data/lib/autoproj/reporter.rb +19 -19
- data/lib/autoproj/repository_managers/apt.rb +101 -67
- data/lib/autoproj/repository_managers/unknown_os_manager.rb +3 -3
- data/lib/autoproj/shell_completion.rb +16 -13
- data/lib/autoproj/source_package_query.rb +29 -36
- data/lib/autoproj/system.rb +32 -21
- data/lib/autoproj/test.rb +131 -106
- data/lib/autoproj/variable_expansion.rb +10 -10
- data/lib/autoproj/vcs_definition.rb +53 -37
- data/lib/autoproj/version.rb +1 -1
- data/lib/autoproj/workspace.rb +162 -117
- data/lib/autoproj/zsh_completion.rb +8 -9
- data/lib/autoproj.rb +53 -53
- data/samples/autoproj/init.rb +1 -2
- metadata +62 -72
- data/.travis.yml +0 -22
@@ -1,627 +1,632 @@
|
|
1
1
|
module Autoproj
|
2
2
|
module Ops
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
3
|
+
#--
|
4
|
+
# NOTE: indentation is wrong to let git track the history properly
|
5
|
+
#+++
|
6
|
+
|
7
|
+
# Implementation of the operations to manage the configuration
|
8
|
+
class Configuration
|
9
|
+
attr_reader :ws
|
10
|
+
|
11
|
+
# The autoproj install we should update from (if any)
|
12
|
+
#
|
13
|
+
# @return [nil,InstallationManifest]
|
14
|
+
attr_reader :update_from
|
15
|
+
|
16
|
+
# The path in which remote package sets should be exposed to the
|
17
|
+
# user
|
18
|
+
#
|
19
|
+
# @return [String]
|
20
|
+
def remotes_dir
|
21
|
+
ws.remotes_dir
|
22
|
+
end
|
23
23
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
24
|
+
# The path in which remote package sets should be exposed to the
|
25
|
+
# user
|
26
|
+
#
|
27
|
+
# @return [String]
|
28
|
+
def remotes_user_dir
|
29
|
+
File.join(ws.config_dir, "remotes")
|
30
|
+
end
|
31
31
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
32
|
+
# The path to the main manifest file
|
33
|
+
#
|
34
|
+
# @return [String]
|
35
|
+
def manifest_path
|
36
|
+
ws.manifest_file_path
|
37
|
+
end
|
38
38
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
39
|
+
# @param [Manifest] manifest
|
40
|
+
# @param [Loader] loader
|
41
|
+
# @option options [InstallationManifest] :update_from
|
42
|
+
# another autoproj installation from which we
|
43
|
+
# should update (instead of the normal VCS)
|
44
|
+
def initialize(workspace, update_from: nil)
|
45
|
+
@ws = workspace
|
46
|
+
@update_from = update_from
|
47
|
+
@remote_update_message_displayed = false
|
48
|
+
end
|
49
49
|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
50
|
+
# Imports or updates a source (remote or otherwise).
|
51
|
+
#
|
52
|
+
# See create_autobuild_package for informations about the arguments.
|
53
|
+
def update_configuration_repository(vcs, name, into,
|
54
54
|
only_local: false,
|
55
55
|
reset: false,
|
56
56
|
retry_count: nil)
|
57
57
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
58
|
+
fake_package = Tools.create_autobuild_package(vcs, name, into)
|
59
|
+
if update_from
|
60
|
+
# Define a package in the installation manifest that points to
|
61
|
+
# the desired folder in other_root
|
62
|
+
relative_path = Pathname.new(into)
|
63
|
+
.relative_path_from(Pathname.new(ws.root_dir)).to_s
|
64
|
+
other_dir = File.join(update_from.path, relative_path)
|
65
|
+
if File.directory?(other_dir)
|
66
|
+
update_from.packages.unshift(
|
67
|
+
InstallationManifest::Package.new(fake_package.name, other_dir, File.join(other_dir, "install"))
|
68
|
+
)
|
69
|
+
end
|
69
70
|
|
70
|
-
|
71
|
-
|
72
|
-
|
71
|
+
# Then move the importer there if possible
|
72
|
+
if fake_package.importer.respond_to?(:pick_from_autoproj_root)
|
73
|
+
unless fake_package.importer.pick_from_autoproj_root(fake_package, update_from)
|
74
|
+
fake_package.update = false
|
75
|
+
end
|
76
|
+
else
|
73
77
|
fake_package.update = false
|
74
78
|
end
|
75
|
-
else
|
76
|
-
fake_package.update = false
|
77
79
|
end
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
fake_package.import(only_local: only_local, reset: reset)
|
83
|
-
|
84
|
-
rescue Autobuild::ConfigException => e
|
85
|
-
raise ConfigError.new, "cannot import #{name}: #{e.message}", e.backtrace
|
86
|
-
end
|
87
|
-
|
88
|
-
# Update the main configuration repository
|
89
|
-
#
|
90
|
-
# @return [Boolean] true if something got updated or checked out,
|
91
|
-
# and false otherwise
|
92
|
-
def update_main_configuration(keep_going: false, checkout_only: !Autobuild.do_update, only_local: false, reset: false, retry_count: nil)
|
93
|
-
if checkout_only && File.exist?(ws.config_dir)
|
94
|
-
return []
|
80
|
+
fake_package.importer.retry_count = retry_count if retry_count
|
81
|
+
fake_package.import(only_local: only_local, reset: reset)
|
82
|
+
rescue Autobuild::ConfigException => e
|
83
|
+
raise ConfigError.new, "cannot import #{name}: #{e.message}", e.backtrace
|
95
84
|
end
|
96
85
|
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
86
|
+
# Update the main configuration repository
|
87
|
+
#
|
88
|
+
# @return [Boolean] true if something got updated or checked out,
|
89
|
+
# and false otherwise
|
90
|
+
def update_main_configuration(keep_going: false, checkout_only: !Autobuild.do_update, only_local: false, reset: false, retry_count: nil)
|
91
|
+
return [] if checkout_only && File.exist?(ws.config_dir)
|
92
|
+
|
93
|
+
update_configuration_repository(
|
94
|
+
ws.manifest.vcs, "autoproj main configuration", ws.config_dir,
|
95
|
+
only_local: only_local, reset: reset, retry_count: retry_count
|
96
|
+
)
|
97
|
+
[]
|
98
|
+
rescue Interrupt
|
99
|
+
raise
|
100
|
+
rescue Exception => e
|
101
|
+
if keep_going
|
102
|
+
[e]
|
103
|
+
else
|
104
|
+
raise e
|
105
|
+
end
|
109
106
|
end
|
110
|
-
end
|
111
107
|
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
108
|
+
# Update or checkout a remote package set, based on its VCS definition
|
109
|
+
#
|
110
|
+
# @param [VCSDefinition] vcs the package set VCS
|
111
|
+
# @return [Boolean] true if something got updated or checked out,
|
112
|
+
# and false otherwise
|
113
|
+
def update_remote_package_set(vcs,
|
118
114
|
checkout_only: !Autobuild.do_update,
|
119
115
|
only_local: false,
|
120
116
|
reset: false,
|
121
117
|
retry_count: nil)
|
122
118
|
|
123
|
-
|
124
|
-
|
125
|
-
return
|
126
|
-
end
|
119
|
+
raw_local_dir = PackageSet.raw_local_dir_of(ws, vcs)
|
120
|
+
return if checkout_only && File.exist?(raw_local_dir)
|
127
121
|
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
122
|
+
# name_of does minimal validation of source.yml, so do it here
|
123
|
+
# even though we don't really need it
|
124
|
+
name = PackageSet.name_of(ws, vcs, ignore_load_errors: true)
|
125
|
+
ws.install_os_packages([vcs.type], all: nil)
|
126
|
+
update_configuration_repository(
|
127
|
+
vcs, name, raw_local_dir,
|
128
|
+
only_local: only_local,
|
129
|
+
reset: reset,
|
130
|
+
retry_count: retry_count
|
131
|
+
)
|
132
|
+
end
|
138
133
|
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
134
|
+
# Create the user-visible directory for a remote package set
|
135
|
+
#
|
136
|
+
# @param [VCSDefinition] vcs the package set VCS
|
137
|
+
# @return [String] the full path to the created user dir
|
138
|
+
def create_remote_set_user_dir(vcs)
|
139
|
+
name = PackageSet.name_of(ws, vcs)
|
140
|
+
raw_local_dir = PackageSet.raw_local_dir_of(ws, vcs)
|
141
|
+
FileUtils.mkdir_p(remotes_user_dir)
|
142
|
+
symlink_dest = File.join(remotes_user_dir, name)
|
143
|
+
|
144
|
+
# Check if the current symlink is valid, and recreate it if it
|
145
|
+
# is not
|
146
|
+
if File.symlink?(symlink_dest)
|
147
|
+
dest = File.readlink(symlink_dest)
|
148
|
+
if dest != raw_local_dir
|
149
|
+
FileUtils.rm_f symlink_dest
|
150
|
+
Autoproj.create_symlink(raw_local_dir, symlink_dest)
|
151
|
+
end
|
152
|
+
else
|
154
153
|
FileUtils.rm_f symlink_dest
|
155
154
|
Autoproj.create_symlink(raw_local_dir, symlink_dest)
|
156
155
|
end
|
157
|
-
else
|
158
|
-
FileUtils.rm_f symlink_dest
|
159
|
-
Autoproj.create_symlink(raw_local_dir, symlink_dest)
|
160
|
-
end
|
161
156
|
|
162
|
-
|
163
|
-
end
|
164
|
-
|
165
|
-
def load_package_set(vcs, options, imported_from)
|
166
|
-
pkg_set = PackageSet.new(ws, vcs)
|
167
|
-
pkg_set.auto_imports = options[:auto_imports]
|
168
|
-
ws.load_if_present(pkg_set, pkg_set.local_dir, 'init.rb')
|
169
|
-
pkg_set.load_description_file
|
170
|
-
if imported_from
|
171
|
-
pkg_set.imported_from << imported_from
|
172
|
-
imported_from.imports << pkg_set
|
157
|
+
symlink_dest
|
173
158
|
end
|
174
|
-
pkg_set
|
175
|
-
end
|
176
159
|
|
177
|
-
|
178
|
-
|
179
|
-
pkg_set.
|
180
|
-
|
181
|
-
|
182
|
-
|
160
|
+
def load_package_set(vcs, options, imported_from)
|
161
|
+
pkg_set = PackageSet.new(ws, vcs)
|
162
|
+
pkg_set.auto_imports = options[:auto_imports]
|
163
|
+
ws.load_if_present(pkg_set, pkg_set.local_dir, "init.rb")
|
164
|
+
pkg_set.load_description_file
|
165
|
+
if imported_from
|
166
|
+
pkg_set.imported_from << imported_from
|
167
|
+
imported_from.imports << pkg_set
|
183
168
|
end
|
169
|
+
pkg_set
|
184
170
|
end
|
185
|
-
queue
|
186
|
-
end
|
187
171
|
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
# @yieldparam [String] osdep the name of an osdep required to import the
|
195
|
-
# package sets
|
196
|
-
def load_and_update_package_sets(root_pkg_set,
|
197
|
-
only_local: false,
|
198
|
-
checkout_only: !Autobuild.do_update,
|
199
|
-
keep_going: false,
|
200
|
-
reset: false,
|
201
|
-
retry_count: nil)
|
202
|
-
package_sets = [root_pkg_set]
|
203
|
-
by_repository_id = Hash.new
|
204
|
-
by_name = Hash.new
|
205
|
-
failures = Array.new
|
206
|
-
|
207
|
-
required_remotes_dirs = Array.new
|
208
|
-
|
209
|
-
queue = queue_auto_imports_if_needed(Array.new, root_pkg_set, root_pkg_set)
|
210
|
-
while !queue.empty?
|
211
|
-
vcs, import_options, imported_from = queue.shift
|
212
|
-
repository_id = vcs.overrides_key
|
213
|
-
if already_processed = by_repository_id[repository_id]
|
214
|
-
already_processed_vcs, already_processed_from, pkg_set = *already_processed
|
215
|
-
if (already_processed_from != root_pkg_set) && (already_processed_vcs != vcs)
|
216
|
-
Autoproj.warn "already loaded the package set from #{already_processed_vcs} from #{already_processed_from.name}, this overrides different settings (#{vcs}) found in #{imported_from.name}"
|
172
|
+
def queue_auto_imports_if_needed(queue, pkg_set, root_set)
|
173
|
+
if pkg_set.auto_imports?
|
174
|
+
pkg_set.each_raw_imported_set do |import_vcs, import_options|
|
175
|
+
vcs_overrides_key = import_vcs.overrides_key
|
176
|
+
import_vcs = root_set.resolve_overrides("pkg_set:#{vcs_overrides_key}", import_vcs)
|
177
|
+
queue << [import_vcs, import_options, pkg_set]
|
217
178
|
end
|
218
|
-
|
219
|
-
if imported_from
|
220
|
-
pkg_set.imported_from << imported_from
|
221
|
-
imported_from.imports << pkg_set
|
222
|
-
end
|
223
|
-
next
|
224
179
|
end
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
180
|
+
queue
|
181
|
+
end
|
182
|
+
|
183
|
+
# Load the package set information
|
184
|
+
#
|
185
|
+
# It loads the package set information as required by {manifest} and
|
186
|
+
# makes sure that they are either updated (if Autobuild.do_update is
|
187
|
+
# true), or at least checked out.
|
188
|
+
#
|
189
|
+
# @yieldparam [String] osdep the name of an osdep required to import the
|
190
|
+
# package sets
|
191
|
+
def load_and_update_package_sets(root_pkg_set,
|
192
|
+
only_local: false,
|
193
|
+
checkout_only: !Autobuild.do_update,
|
194
|
+
keep_going: false,
|
195
|
+
reset: false,
|
196
|
+
retry_count: nil)
|
197
|
+
package_sets = [root_pkg_set]
|
198
|
+
by_repository_id = Hash.new
|
199
|
+
by_name = Hash.new
|
200
|
+
failures = Array.new
|
201
|
+
|
202
|
+
required_remotes_dirs = Array.new
|
203
|
+
|
204
|
+
queue = queue_auto_imports_if_needed(Array.new, root_pkg_set, root_pkg_set)
|
205
|
+
until queue.empty?
|
206
|
+
vcs, import_options, imported_from = queue.shift
|
207
|
+
repository_id = vcs.overrides_key
|
208
|
+
if (already_processed = by_repository_id[repository_id])
|
209
|
+
already_processed_vcs, already_processed_from, pkg_set = *already_processed
|
210
|
+
if (already_processed_from != root_pkg_set) && (already_processed_vcs != vcs)
|
211
|
+
Autoproj.warn "already loaded the package set from #{already_processed_vcs} from #{already_processed_from.name}, this overrides different settings (#{vcs}) found in #{imported_from.name}"
|
212
|
+
end
|
237
213
|
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
214
|
+
if imported_from
|
215
|
+
pkg_set.imported_from << imported_from
|
216
|
+
imported_from.imports << pkg_set
|
217
|
+
end
|
218
|
+
next
|
242
219
|
end
|
220
|
+
by_repository_id[repository_id] = [vcs, imported_from]
|
221
|
+
|
222
|
+
# Make sure the package set has been already checked out to
|
223
|
+
# retrieve the actual name of the package set
|
224
|
+
unless vcs.local?
|
225
|
+
failed = handle_keep_going(keep_going, vcs, failures) do
|
226
|
+
update_remote_package_set(
|
227
|
+
vcs, checkout_only: checkout_only,
|
228
|
+
only_local: only_local, reset: reset,
|
229
|
+
retry_count: retry_count
|
230
|
+
)
|
231
|
+
end
|
232
|
+
raw_local_dir = PackageSet.raw_local_dir_of(ws, vcs)
|
243
233
|
|
244
|
-
|
245
|
-
|
234
|
+
# We really can't continue if the VCS was being checked out
|
235
|
+
# and that failed
|
236
|
+
raise failures.last if failed && !File.directory?(raw_local_dir)
|
246
237
|
|
247
|
-
|
238
|
+
required_remotes_dirs << raw_local_dir
|
239
|
+
end
|
248
240
|
|
249
|
-
|
250
|
-
|
251
|
-
|
241
|
+
name = PackageSet.name_of(ws, vcs)
|
242
|
+
|
243
|
+
required_user_dirs = by_name.collect { |k, v| k }
|
244
|
+
Autoproj.debug "Trying to load package_set: #{name} from definition #{repository_id}"
|
245
|
+
Autoproj.debug "Already loaded package_sets are: #{required_user_dirs}"
|
246
|
+
|
247
|
+
if (already_loaded = by_name[name])
|
248
|
+
already_loaded_pkg_set, already_loaded_vcs = *already_loaded
|
249
|
+
if already_loaded_vcs != vcs
|
250
|
+
if imported_from
|
251
|
+
Autoproj.warn "redundant auto-import of package set '#{name}' by package set '#{imported_from.name}'"
|
252
|
+
Autoproj.warn " A package set with the same name has already been imported from"
|
253
|
+
Autoproj.warn " #{already_loaded_vcs}"
|
254
|
+
Autoproj.warn " Skipping the following one: "
|
255
|
+
Autoproj.warn " #{vcs}"
|
256
|
+
else
|
257
|
+
Autoproj.warn "the manifest refers to a package set from #{vcs}, but a package set with the same name (#{name}) has already been imported from #{already_loaded_vcs}, I am skipping this one"
|
258
|
+
end
|
259
|
+
end
|
252
260
|
|
253
|
-
if already_loaded = by_name[name]
|
254
|
-
already_loaded_pkg_set, already_loaded_vcs = *already_loaded
|
255
|
-
if already_loaded_vcs != vcs
|
256
261
|
if imported_from
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
Autoproj.warn " Skipping the following one: "
|
261
|
-
Autoproj.warn " #{vcs}"
|
262
|
-
else
|
263
|
-
Autoproj.warn "the manifest refers to a package set from #{vcs}, but a package set with the same name (#{name}) has already been imported from #{already_loaded_vcs}, I am skipping this one"
|
262
|
+
already_loaded_pkg_set.imported_from << imported_from
|
263
|
+
imported_from.imports << already_loaded_pkg_set
|
264
|
+
by_repository_id[repository_id][2] = already_loaded_pkg_set
|
264
265
|
end
|
266
|
+
next
|
265
267
|
end
|
266
268
|
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
end
|
272
|
-
next
|
273
|
-
end
|
269
|
+
create_remote_set_user_dir(vcs) unless vcs.local?
|
270
|
+
pkg_set = load_package_set(vcs, import_options, imported_from)
|
271
|
+
by_repository_id[repository_id][2] = pkg_set
|
272
|
+
package_sets << pkg_set
|
274
273
|
|
275
|
-
|
276
|
-
|
274
|
+
by_name[pkg_set.name] = [pkg_set, vcs, import_options, imported_from]
|
275
|
+
|
276
|
+
# Finally, queue the imports
|
277
|
+
queue_auto_imports_if_needed(queue, pkg_set, root_pkg_set)
|
277
278
|
end
|
278
|
-
pkg_set = load_package_set(vcs, import_options, imported_from)
|
279
|
-
by_repository_id[repository_id][2] = pkg_set
|
280
|
-
package_sets << pkg_set
|
281
279
|
|
282
|
-
by_name
|
280
|
+
required_user_dirs = by_name.collect { |k, v| k }
|
281
|
+
cleanup_remotes_dir(package_sets, required_remotes_dirs)
|
282
|
+
cleanup_remotes_user_dir(package_sets, required_user_dirs)
|
283
283
|
|
284
|
-
|
285
|
-
queue_auto_imports_if_needed(queue, pkg_set, root_pkg_set)
|
284
|
+
[package_sets, failures]
|
286
285
|
end
|
287
286
|
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
Dir.glob(File.join(remotes_dir, '*')).each do |dir|
|
300
|
-
dir = File.expand_path(dir)
|
301
|
-
# Once a package set has been checked out during the process,
|
302
|
-
# keep it -- so that it won't be checked out again
|
303
|
-
if File.directory?(dir) && !required_remotes_dirs.include?(dir)
|
304
|
-
FileUtils.rm_rf dir
|
287
|
+
# Removes from {remotes_dir} the directories that do not match a package
|
288
|
+
# set
|
289
|
+
def cleanup_remotes_dir(package_sets = ws.manifest.package_sets, required_remotes_dirs = Array.new)
|
290
|
+
# Cleanup the .remotes and remotes_symlinks_dir directories
|
291
|
+
Dir.glob(File.join(remotes_dir, "*")).each do |dir|
|
292
|
+
dir = File.expand_path(dir)
|
293
|
+
# Once a package set has been checked out during the process,
|
294
|
+
# keep it -- so that it won't be checked out again
|
295
|
+
if File.directory?(dir) && !required_remotes_dirs.include?(dir)
|
296
|
+
FileUtils.rm_rf dir
|
297
|
+
end
|
305
298
|
end
|
306
299
|
end
|
307
|
-
end
|
308
300
|
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
301
|
+
# Removes from {remotes_user_dir} the directories that do not match a
|
302
|
+
# package set
|
303
|
+
def cleanup_remotes_user_dir(package_sets = ws.manifest.package_sets, required_user_dirs = Array.new)
|
304
|
+
Dir.glob(File.join(remotes_user_dir, "*")).each do |file|
|
305
|
+
file = File.expand_path(file)
|
306
|
+
user_dir = File.basename(file)
|
307
|
+
if File.symlink?(file) && !required_user_dirs.include?(user_dir)
|
308
|
+
FileUtils.rm_f file
|
309
|
+
end
|
317
310
|
end
|
318
311
|
end
|
319
|
-
end
|
320
312
|
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
313
|
+
def inspect
|
314
|
+
to_s
|
315
|
+
end
|
316
|
+
|
317
|
+
def sort_package_sets_by_import_order(package_sets, root_pkg_set)
|
318
|
+
# The sorting is done in two steps:
|
319
|
+
# - first, we build a topological order of the package sets
|
320
|
+
# - then, we insert the auto-imported packages, following this
|
321
|
+
# topological order, in the user-provided order. Each package is
|
322
|
+
# considered in turn, and added at the earliest place that fits
|
323
|
+
# the dependencies
|
324
|
+
topological = Array.new
|
325
|
+
queue = (package_sets.to_a + [root_pkg_set]).uniq
|
326
|
+
until queue.empty?
|
327
|
+
last_size = queue.size
|
328
|
+
pending = queue.dup
|
329
|
+
queue = Array.new
|
330
|
+
until pending.empty?
|
331
|
+
pkg_set = pending.shift
|
332
|
+
if pkg_set.imports.any? { |imported_set| !topological.include?(imported_set) }
|
333
|
+
queue.push(pkg_set)
|
334
|
+
else
|
335
|
+
topological << pkg_set
|
336
|
+
end
|
337
|
+
end
|
338
|
+
if queue.size == last_size
|
339
|
+
raise ArgumentError, "cannot resolve the dependencies between package sets. There seem to be a cycle amongst #{queue.map(&:name).sort.join(', ')}"
|
342
340
|
end
|
343
341
|
end
|
344
|
-
if queue.size == last_size
|
345
|
-
raise ArgumentError, "cannot resolve the dependencies between package sets. There seem to be a cycle amongst #{queue.map(&:name).sort.join(", ")}"
|
346
|
-
end
|
347
|
-
end
|
348
342
|
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
343
|
+
result = root_pkg_set.imports.to_a.dup
|
344
|
+
to_insert = topological.dup
|
345
|
+
.find_all { |p| !result.include?(p) }
|
346
|
+
until to_insert.empty?
|
347
|
+
pkg_set = to_insert.shift
|
348
|
+
dependencies = pkg_set.imports.dup
|
349
|
+
if dependencies.empty?
|
350
|
+
result.unshift(pkg_set)
|
351
|
+
else
|
352
|
+
i = result.find_index do |p|
|
353
|
+
dependencies.delete(p)
|
354
|
+
dependencies.empty?
|
355
|
+
end
|
356
|
+
result.insert(i + 1, pkg_set)
|
361
357
|
end
|
362
|
-
result.insert(i + 1, pkg_set)
|
363
358
|
end
|
364
|
-
end
|
365
359
|
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
360
|
+
# Sanity check related to the root package set
|
361
|
+
# - it should be last
|
362
|
+
# - it should be present only once
|
363
|
+
if result.last != root_pkg_set
|
364
|
+
raise InternalError, "failed to sort the package sets: the root package set should be last, but is not"
|
365
|
+
end
|
366
|
+
|
367
|
+
result
|
371
368
|
end
|
372
|
-
result
|
373
|
-
end
|
374
369
|
|
375
|
-
|
370
|
+
def load_package_sets(
|
376
371
|
only_local: false,
|
377
372
|
checkout_only: true,
|
378
373
|
keep_going: false,
|
379
374
|
reset: false,
|
380
375
|
retry_count: nil,
|
381
|
-
mainline: nil
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
376
|
+
mainline: nil
|
377
|
+
)
|
378
|
+
update_configuration(
|
379
|
+
only_local: only_local,
|
380
|
+
checkout_only: checkout_only,
|
381
|
+
keep_going: keep_going,
|
382
|
+
reset: reset,
|
383
|
+
retry_count: retry_count,
|
384
|
+
mainline: mainline
|
385
|
+
)
|
386
|
+
end
|
390
387
|
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
388
|
+
def report_import_failure(what, reason)
|
389
|
+
unless reason.kind_of?(Interrupt)
|
390
|
+
Autoproj.message "import of #{what} failed", :red
|
391
|
+
Autoproj.message reason.to_s, :red
|
392
|
+
end
|
395
393
|
end
|
396
|
-
end
|
397
394
|
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
raise
|
403
|
-
rescue Exception => failure_reason
|
404
|
-
if keep_going
|
405
|
-
report_import_failure(vcs, failure_reason)
|
406
|
-
failures << failure_reason
|
407
|
-
true
|
408
|
-
else
|
395
|
+
def handle_keep_going(keep_going, vcs, failures)
|
396
|
+
yield
|
397
|
+
false
|
398
|
+
rescue Interrupt
|
409
399
|
raise
|
400
|
+
rescue Exception => failure_reason
|
401
|
+
if keep_going
|
402
|
+
report_import_failure(vcs, failure_reason)
|
403
|
+
failures << failure_reason
|
404
|
+
true
|
405
|
+
else
|
406
|
+
raise
|
407
|
+
end
|
410
408
|
end
|
411
|
-
end
|
412
409
|
|
413
|
-
|
410
|
+
def update_configuration(
|
414
411
|
only_local: false,
|
415
412
|
checkout_only: !Autobuild.do_update,
|
416
413
|
keep_going: false,
|
417
414
|
reset: false,
|
418
415
|
retry_count: nil,
|
419
|
-
mainline: nil
|
416
|
+
mainline: nil
|
417
|
+
)
|
420
418
|
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
419
|
+
if ws.manifest.vcs.needs_import?
|
420
|
+
main_configuration_failure = update_main_configuration(
|
421
|
+
keep_going: keep_going,
|
422
|
+
checkout_only: checkout_only,
|
423
|
+
only_local: only_local,
|
424
|
+
reset: reset,
|
425
|
+
retry_count: retry_count
|
426
|
+
)
|
427
|
+
|
428
|
+
main_configuration_failure.each do |e|
|
429
|
+
report_import_failure("main configuration", e)
|
430
|
+
end
|
431
|
+
else
|
432
|
+
main_configuration_failure = []
|
433
|
+
end
|
434
|
+
ws.load_main_initrb
|
435
|
+
ws.manifest.load(manifest_path)
|
436
|
+
root_pkg_set = ws.manifest.main_package_set
|
437
|
+
root_pkg_set.load_description_file
|
438
|
+
root_pkg_set.explicit = true
|
439
|
+
|
440
|
+
package_sets_failure = update_package_sets(
|
425
441
|
only_local: only_local,
|
442
|
+
checkout_only: checkout_only,
|
443
|
+
keep_going: keep_going,
|
426
444
|
reset: reset,
|
427
|
-
retry_count: retry_count
|
445
|
+
retry_count: retry_count
|
446
|
+
)
|
447
|
+
|
448
|
+
load_package_set_information(mainline: mainline)
|
428
449
|
|
429
|
-
main_configuration_failure.
|
430
|
-
|
450
|
+
if !main_configuration_failure.empty? && !package_sets_failure.empty?
|
451
|
+
raise ImportFailed.new(main_configuration_failure + package_sets_failure)
|
452
|
+
elsif !main_configuration_failure.empty?
|
453
|
+
raise ImportFailed.new(main_configuration_failure)
|
454
|
+
elsif !package_sets_failure.empty?
|
455
|
+
raise ImportFailed.new(package_sets_failure)
|
431
456
|
end
|
432
|
-
else
|
433
|
-
main_configuration_failure = []
|
434
457
|
end
|
435
|
-
ws.load_main_initrb
|
436
|
-
ws.manifest.load(manifest_path)
|
437
|
-
root_pkg_set = ws.manifest.main_package_set
|
438
|
-
root_pkg_set.load_description_file
|
439
|
-
root_pkg_set.explicit = true
|
440
|
-
|
441
|
-
package_sets_failure = update_package_sets(
|
442
|
-
only_local: only_local,
|
443
|
-
checkout_only: checkout_only,
|
444
|
-
keep_going: keep_going,
|
445
|
-
reset: reset,
|
446
|
-
retry_count: retry_count)
|
447
|
-
|
448
|
-
load_package_set_information(mainline: mainline)
|
449
|
-
|
450
|
-
if !main_configuration_failure.empty? && !package_sets_failure.empty?
|
451
|
-
raise ImportFailed.new(main_configuration_failure + package_sets_failure)
|
452
|
-
elsif !main_configuration_failure.empty?
|
453
|
-
raise ImportFailed.new(main_configuration_failure)
|
454
|
-
elsif !package_sets_failure.empty?
|
455
|
-
raise ImportFailed.new(package_sets_failure)
|
456
|
-
end
|
457
|
-
end
|
458
458
|
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
459
|
+
def load_package_set_information(mainline: nil)
|
460
|
+
manifest = ws.manifest
|
461
|
+
manifest.each_package_set do |pkg_set|
|
462
|
+
if Gem::Version.new(pkg_set.required_autoproj_version) > Gem::Version.new(Autoproj::VERSION)
|
463
|
+
raise ConfigError.new(pkg_set.source_file), "the #{pkg_set.name} package set requires autoproj v#{pkg_set.required_autoproj_version} but this is v#{Autoproj::VERSION}"
|
464
|
+
end
|
464
465
|
end
|
465
|
-
end
|
466
466
|
|
467
|
-
|
468
|
-
|
467
|
+
# Loads OS repository definitions once and for all
|
468
|
+
load_osrepos_from_package_sets
|
469
469
|
|
470
|
-
|
471
|
-
|
470
|
+
# Loads OS package definitions once and for all
|
471
|
+
load_osdeps_from_package_sets
|
472
472
|
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
473
|
+
# Load the required autobuild definitions
|
474
|
+
manifest.each_package_set do |pkg_set|
|
475
|
+
pkg_set.each_autobuild_file do |path|
|
476
|
+
ws.import_autobuild_file pkg_set, path
|
477
|
+
end
|
477
478
|
end
|
478
|
-
end
|
479
479
|
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
end
|
485
|
-
manifest.load_importers(mainline: mainline)
|
480
|
+
# Now, load the package's importer configurations (from the various
|
481
|
+
# source.yml files)
|
482
|
+
mainline = manifest.package_set(mainline) if mainline.respond_to?(:to_str)
|
483
|
+
manifest.load_importers(mainline: mainline)
|
486
484
|
|
487
|
-
|
485
|
+
auto_add_packages_from_layout
|
488
486
|
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
487
|
+
manifest.each_autobuild_package do |pkg|
|
488
|
+
Autobuild.each_utility do |uname, _|
|
489
|
+
pkg.utility(uname).enabled =
|
490
|
+
ws.config.utility_enabled_for?(uname, pkg.name)
|
491
|
+
end
|
493
492
|
end
|
494
|
-
end
|
495
493
|
|
496
|
-
|
497
|
-
|
494
|
+
mark_unavailable_osdeps_as_excluded
|
495
|
+
end
|
498
496
|
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
497
|
+
# @api private
|
498
|
+
#
|
499
|
+
# Attempts to find packages mentioned in the layout but that are not
|
500
|
+
# defined, and auto-define them if they can be found on disk
|
501
|
+
#
|
502
|
+
# It only warns about packages that can't be defined that way are on
|
503
|
+
def auto_add_packages_from_layout
|
504
|
+
manifest = ws.manifest
|
505
|
+
|
506
|
+
# Auto-add packages that are
|
507
|
+
# * present on disk
|
508
|
+
# * listed in the layout part of the manifest
|
509
|
+
# * but have no definition
|
510
|
+
explicit = manifest.normalized_layout
|
511
|
+
explicit.each do |pkg_or_set, layout_level|
|
512
|
+
next if manifest.find_autobuild_package(pkg_or_set)
|
513
|
+
next if manifest.has_package_set?(pkg_or_set)
|
514
|
+
|
515
|
+
full_path = File.expand_path(
|
516
|
+
File.join(ws.source_dir, layout_level, pkg_or_set)
|
517
|
+
)
|
518
|
+
next unless File.directory?(full_path)
|
519
|
+
|
520
|
+
if (handler = auto_add_package(pkg_or_set, full_path))
|
521
|
+
handler_name = handler.gsub(/_package/, "")
|
522
|
+
layout_level_msg = "in #{layout_level} " if layout_level != "/"
|
523
|
+
Autoproj.message " auto-added #{pkg_or_set} #{layout_level_msg}"\
|
524
|
+
"using the #{handler_name} package handler"
|
525
|
+
else
|
526
|
+
Autoproj.warn "cannot auto-add #{pkg_or_set}: "\
|
527
|
+
"unknown package type"
|
528
|
+
end
|
523
529
|
end
|
524
|
-
|
525
530
|
end
|
526
|
-
end
|
527
531
|
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
532
|
+
# @api private
|
533
|
+
#
|
534
|
+
# Attempts to auto-add the package checked out at the given path
|
535
|
+
#
|
536
|
+
# @param [String] full_path
|
537
|
+
# @return [String,nil] either the name of the package handler used to
|
538
|
+
# define the package, or nil if no handler could be found
|
539
|
+
def auto_add_package(name, full_path)
|
540
|
+
manifest = ws.manifest
|
541
|
+
handler, _srcdir = Autoproj.package_handler_for(full_path)
|
542
|
+
if handler
|
543
|
+
ws.set_as_main_workspace do
|
544
|
+
ws.in_package_set(manifest.main_package_set, manifest.file) do
|
545
|
+
send(handler, name)
|
546
|
+
end
|
542
547
|
end
|
548
|
+
handler
|
543
549
|
end
|
544
|
-
handler
|
545
550
|
end
|
546
|
-
end
|
547
551
|
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
552
|
+
def mark_unavailable_osdeps_as_excluded
|
553
|
+
os_package_resolver = ws.os_package_resolver
|
554
|
+
manifest = ws.manifest
|
555
|
+
os_package_resolver.all_package_names.each do |osdep_name|
|
556
|
+
# If the osdep can be replaced by source packages, there's
|
557
|
+
# nothing to do really. The exclusions of the source packages
|
558
|
+
# will work as expected
|
559
|
+
if manifest.osdeps_overrides[osdep_name] || manifest.find_autobuild_package(osdep_name)
|
560
|
+
next
|
561
|
+
end
|
558
562
|
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
563
|
+
case os_package_resolver.availability_of(osdep_name)
|
564
|
+
when OSPackageResolver::UNKNOWN_OS
|
565
|
+
manifest.exclude_package(osdep_name, "the current operating system is unknown to autoproj")
|
566
|
+
when OSPackageResolver::WRONG_OS
|
567
|
+
manifest.exclude_package(osdep_name, "#{osdep_name} is defined, but not for this operating system")
|
568
|
+
when OSPackageResolver::NONEXISTENT
|
569
|
+
manifest.exclude_package(osdep_name, "#{osdep_name} is marked as unavailable for this operating system")
|
570
|
+
end
|
566
571
|
end
|
567
572
|
end
|
568
|
-
end
|
569
573
|
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
574
|
+
# Load OS dependency information contained in our registered package
|
575
|
+
# sets into the provided osdep object
|
576
|
+
#
|
577
|
+
# This is included in {load_package_sets}
|
578
|
+
#
|
579
|
+
# @return [void]
|
580
|
+
def load_osdeps_from_package_sets
|
581
|
+
ws.manifest.each_package_set do |pkg_set|
|
582
|
+
pkg_set.each_osdeps_file do |file|
|
583
|
+
file_osdeps = pkg_set.load_osdeps(
|
584
|
+
file, operating_system: ws.operating_system
|
585
|
+
)
|
586
|
+
ws.os_package_resolver.merge(file_osdeps)
|
587
|
+
end
|
582
588
|
end
|
583
589
|
end
|
584
|
-
end
|
585
590
|
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
|
591
|
+
# Load OS repository information contained in our registered package
|
592
|
+
# sets into the provided osrepo object
|
593
|
+
#
|
594
|
+
# This is included in {load_package_sets}
|
595
|
+
#
|
596
|
+
# @return [void]
|
597
|
+
def load_osrepos_from_package_sets
|
598
|
+
ws.manifest.each_package_set do |pkg_set|
|
599
|
+
pkg_set.each_osrepos_file do |file|
|
600
|
+
file_osrepos = pkg_set.load_osrepos(file)
|
601
|
+
ws.os_repository_resolver.merge(file_osrepos)
|
602
|
+
end
|
597
603
|
end
|
598
604
|
end
|
599
|
-
end
|
600
605
|
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
606
|
+
def update_package_sets(only_local: false,
|
607
|
+
checkout_only: !Autobuild.do_update,
|
608
|
+
keep_going: false,
|
609
|
+
reset: false,
|
610
|
+
retry_count: nil)
|
611
|
+
root_pkg_set = ws.manifest.main_package_set
|
612
|
+
package_sets, failures = load_and_update_package_sets(
|
613
|
+
root_pkg_set,
|
614
|
+
only_local: only_local,
|
615
|
+
checkout_only: checkout_only,
|
616
|
+
keep_going: keep_going,
|
617
|
+
reset: reset,
|
618
|
+
retry_count: retry_count
|
619
|
+
)
|
620
|
+
root_pkg_set.imports.each do |pkg_set|
|
621
|
+
pkg_set.explicit = true
|
622
|
+
end
|
623
|
+
package_sets = sort_package_sets_by_import_order(package_sets, root_pkg_set)
|
624
|
+
ws.manifest.reset_package_sets
|
625
|
+
package_sets.each do |pkg_set|
|
626
|
+
ws.manifest.register_package_set(pkg_set)
|
627
|
+
end
|
628
|
+
failures
|
621
629
|
end
|
622
|
-
failures
|
623
630
|
end
|
624
631
|
end
|
625
|
-
end
|
626
632
|
end
|
627
|
-
|