autoproj 2.0.0.rc10 → 2.0.0.rc11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/autoproj_bootstrap +5 -5
- data/bin/autoproj_install +5 -5
- data/lib/autoproj/cli.rb +8 -1
- data/lib/autoproj/ops/install.rb +5 -5
- data/lib/autoproj/os_package_installer.rb +23 -29
- data/lib/autoproj/package_managers/apt_dpkg_manager.rb +9 -9
- data/lib/autoproj/package_managers/bundler_manager.rb +26 -11
- data/lib/autoproj/package_managers/homebrew_manager.rb +8 -1
- data/lib/autoproj/package_managers/pip_manager.rb +1 -1
- data/lib/autoproj/package_managers/shell_script_manager.rb +8 -7
- data/lib/autoproj/package_managers/yum_manager.rb +8 -4
- data/lib/autoproj/package_managers/zypper_manager.rb +8 -4
- data/lib/autoproj/version.rb +1 -1
- data/lib/autoproj/workspace.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e6381f80415323f5ad799fe1c75765244b7a363e
|
4
|
+
data.tar.gz: efebe68499b6ca24e0e21ad6d7753b9cad36f11c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: baf063f359e48c6b64276409753c8cae38544a144597558640c45a8962b9cfbceed3e9d617697e3988dfb5f30b543416398024758447d55cff9947c548a7e575
|
7
|
+
data.tar.gz: c0859c77140d14dfcbaf3c18b280d49ad25f50336e2e18b30c9c895757a2a7f9a3394ace2fd1aa4b7f5a1a6ae5c5433ecadb9784f19e837a7eae1d7f3a441caf
|
data/bin/autoproj_bootstrap
CHANGED
@@ -49,7 +49,7 @@ module Autoproj
|
|
49
49
|
end
|
50
50
|
|
51
51
|
def env_for_child
|
52
|
-
env.inject(Hash.new) do |h, (k, v)|
|
52
|
+
result = env.inject(Hash.new) do |h, (k, v)|
|
53
53
|
h[k] = (v.join(File::PATH_SEPARATOR) if v && !v.empty?)
|
54
54
|
h
|
55
55
|
end
|
@@ -98,7 +98,7 @@ module Autoproj
|
|
98
98
|
def private_bundler?; !!@private_bundler end
|
99
99
|
# The path to the directory into which the bundler gem should be
|
100
100
|
# installed
|
101
|
-
def bundler_gem_home; @private_bundler ||
|
101
|
+
def bundler_gem_home; @private_bundler || Gem.user_dir end
|
102
102
|
# (see #private_bundler?)
|
103
103
|
def private_bundler=(flag)
|
104
104
|
@private_bundler =
|
@@ -112,7 +112,7 @@ module Autoproj
|
|
112
112
|
def private_autoproj?; !!@private_autoproj end
|
113
113
|
# The path to the directory into which the autoproj gem should be
|
114
114
|
# installed
|
115
|
-
def autoproj_gem_home; @private_autoproj ||
|
115
|
+
def autoproj_gem_home; @private_autoproj || Gem.user_dir end
|
116
116
|
# (see #private_autoproj?)
|
117
117
|
def private_autoproj=(flag)
|
118
118
|
@private_autoproj =
|
@@ -233,7 +233,7 @@ module Autoproj
|
|
233
233
|
STDERR.puts "cannot find 'bundler' in PATH=#{clean_path}#{File::PATH_SEPARATOR}#{gem_bindir}"
|
234
234
|
STDERR.puts "installing it now ..."
|
235
235
|
result = system(
|
236
|
-
clean_env.merge('GEM_PATH' => "", 'GEM_HOME' =>
|
236
|
+
clean_env.merge('GEM_PATH' => "", 'GEM_HOME' => bundler_gem_home),
|
237
237
|
Gem.ruby, '-S', 'gem', 'install', 'bundler')
|
238
238
|
|
239
239
|
if !result
|
@@ -249,7 +249,7 @@ module Autoproj
|
|
249
249
|
end
|
250
250
|
end
|
251
251
|
|
252
|
-
bundler = File.join(
|
252
|
+
bundler = File.join(bundler_gem_home, 'bin', 'bundler')
|
253
253
|
if File.exist?(bundler)
|
254
254
|
bundler
|
255
255
|
else
|
data/bin/autoproj_install
CHANGED
@@ -49,7 +49,7 @@ module Autoproj
|
|
49
49
|
end
|
50
50
|
|
51
51
|
def env_for_child
|
52
|
-
env.inject(Hash.new) do |h, (k, v)|
|
52
|
+
result = env.inject(Hash.new) do |h, (k, v)|
|
53
53
|
h[k] = (v.join(File::PATH_SEPARATOR) if v && !v.empty?)
|
54
54
|
h
|
55
55
|
end
|
@@ -98,7 +98,7 @@ module Autoproj
|
|
98
98
|
def private_bundler?; !!@private_bundler end
|
99
99
|
# The path to the directory into which the bundler gem should be
|
100
100
|
# installed
|
101
|
-
def bundler_gem_home; @private_bundler ||
|
101
|
+
def bundler_gem_home; @private_bundler || Gem.user_dir end
|
102
102
|
# (see #private_bundler?)
|
103
103
|
def private_bundler=(flag)
|
104
104
|
@private_bundler =
|
@@ -112,7 +112,7 @@ module Autoproj
|
|
112
112
|
def private_autoproj?; !!@private_autoproj end
|
113
113
|
# The path to the directory into which the autoproj gem should be
|
114
114
|
# installed
|
115
|
-
def autoproj_gem_home; @private_autoproj ||
|
115
|
+
def autoproj_gem_home; @private_autoproj || Gem.user_dir end
|
116
116
|
# (see #private_autoproj?)
|
117
117
|
def private_autoproj=(flag)
|
118
118
|
@private_autoproj =
|
@@ -233,7 +233,7 @@ module Autoproj
|
|
233
233
|
STDERR.puts "cannot find 'bundler' in PATH=#{clean_path}#{File::PATH_SEPARATOR}#{gem_bindir}"
|
234
234
|
STDERR.puts "installing it now ..."
|
235
235
|
result = system(
|
236
|
-
clean_env.merge('GEM_PATH' => "", 'GEM_HOME' =>
|
236
|
+
clean_env.merge('GEM_PATH' => "", 'GEM_HOME' => bundler_gem_home),
|
237
237
|
Gem.ruby, '-S', 'gem', 'install', 'bundler')
|
238
238
|
|
239
239
|
if !result
|
@@ -249,7 +249,7 @@ module Autoproj
|
|
249
249
|
end
|
250
250
|
end
|
251
251
|
|
252
|
-
bundler = File.join(
|
252
|
+
bundler = File.join(bundler_gem_home, 'bin', 'bundler')
|
253
253
|
if File.exist?(bundler)
|
254
254
|
bundler
|
255
255
|
else
|
data/lib/autoproj/cli.rb
CHANGED
@@ -4,7 +4,14 @@ class InvalidArguments < Exception
|
|
4
4
|
end
|
5
5
|
|
6
6
|
def self.load_plugins
|
7
|
-
|
7
|
+
finder_name =
|
8
|
+
if Gem.respond_to?(:find_latest_files)
|
9
|
+
:find_latest_files
|
10
|
+
else
|
11
|
+
:find_files
|
12
|
+
end
|
13
|
+
|
14
|
+
Gem.send(finder_name, 'autoproj-*', true).each do |path|
|
8
15
|
require path
|
9
16
|
end
|
10
17
|
end
|
data/lib/autoproj/ops/install.rb
CHANGED
@@ -42,7 +42,7 @@ def initialize(root_dir)
|
|
42
42
|
end
|
43
43
|
|
44
44
|
def env_for_child
|
45
|
-
env.inject(Hash.new) do |h, (k, v)|
|
45
|
+
result = env.inject(Hash.new) do |h, (k, v)|
|
46
46
|
h[k] = (v.join(File::PATH_SEPARATOR) if v && !v.empty?)
|
47
47
|
h
|
48
48
|
end
|
@@ -91,7 +91,7 @@ def local=(flag); @local = flag end
|
|
91
91
|
def private_bundler?; !!@private_bundler end
|
92
92
|
# The path to the directory into which the bundler gem should be
|
93
93
|
# installed
|
94
|
-
def bundler_gem_home; @private_bundler ||
|
94
|
+
def bundler_gem_home; @private_bundler || Gem.user_dir end
|
95
95
|
# (see #private_bundler?)
|
96
96
|
def private_bundler=(flag)
|
97
97
|
@private_bundler =
|
@@ -105,7 +105,7 @@ def private_bundler=(flag)
|
|
105
105
|
def private_autoproj?; !!@private_autoproj end
|
106
106
|
# The path to the directory into which the autoproj gem should be
|
107
107
|
# installed
|
108
|
-
def autoproj_gem_home; @private_autoproj ||
|
108
|
+
def autoproj_gem_home; @private_autoproj || Gem.user_dir end
|
109
109
|
# (see #private_autoproj?)
|
110
110
|
def private_autoproj=(flag)
|
111
111
|
@private_autoproj =
|
@@ -226,7 +226,7 @@ def find_bundler
|
|
226
226
|
STDERR.puts "cannot find 'bundler' in PATH=#{clean_path}#{File::PATH_SEPARATOR}#{gem_bindir}"
|
227
227
|
STDERR.puts "installing it now ..."
|
228
228
|
result = system(
|
229
|
-
clean_env.merge('GEM_PATH' => "", 'GEM_HOME' =>
|
229
|
+
clean_env.merge('GEM_PATH' => "", 'GEM_HOME' => bundler_gem_home),
|
230
230
|
Gem.ruby, '-S', 'gem', 'install', 'bundler')
|
231
231
|
|
232
232
|
if !result
|
@@ -242,7 +242,7 @@ def find_bundler
|
|
242
242
|
end
|
243
243
|
end
|
244
244
|
|
245
|
-
bundler = File.join(
|
245
|
+
bundler = File.join(bundler_gem_home, 'bin', 'bundler')
|
246
246
|
if File.exist?(bundler)
|
247
247
|
bundler
|
248
248
|
else
|
@@ -36,6 +36,9 @@ class OSPackageInstaller
|
|
36
36
|
# The set of packages that have already been installed
|
37
37
|
attr_reader :installed_packages
|
38
38
|
|
39
|
+
# The set of resolved packages that have already been installed
|
40
|
+
attr_reader :installed_resolved_packages
|
41
|
+
|
39
42
|
attr_writer :silent
|
40
43
|
def silent?; @silent end
|
41
44
|
|
@@ -47,6 +50,7 @@ def initialize(ws, os_package_resolver)
|
|
47
50
|
@ws = ws
|
48
51
|
@os_package_resolver = os_package_resolver
|
49
52
|
@installed_packages = Set.new
|
53
|
+
@installed_resolved_packages = Hash.new { |h, k| h[k] = Set.new }
|
50
54
|
@silent = true
|
51
55
|
@filter_uptodate_packages = true
|
52
56
|
end
|
@@ -253,15 +257,12 @@ def osdeps_mode
|
|
253
257
|
# enabled. The default value is returned by {#osdeps_mode}
|
254
258
|
# @return [Array<PackageManagers::Manager>] the set of enabled package
|
255
259
|
# managers
|
256
|
-
def setup_package_managers(
|
257
|
-
options = Kernel.validate_options options,
|
258
|
-
osdeps_mode: osdeps_mode
|
259
|
-
|
260
|
+
def setup_package_managers(osdeps_mode: self.osdeps_mode)
|
260
261
|
os_package_manager.enabled = false
|
261
262
|
package_managers.each_value do |handler|
|
262
263
|
handler.enabled = false
|
263
264
|
end
|
264
|
-
|
265
|
+
osdeps_mode.each do |m|
|
265
266
|
if m == 'os'
|
266
267
|
os_package_manager.enabled = true
|
267
268
|
elsif pkg = package_managers[m]
|
@@ -306,16 +307,13 @@ def pristine(packages, options = Hash.new)
|
|
306
307
|
end
|
307
308
|
|
308
309
|
# Requests the installation of the given set of packages
|
309
|
-
def install(
|
310
|
-
|
311
|
-
|
312
|
-
return false if packages.empty?
|
310
|
+
def install(osdep_packages, install_only: false, **options)
|
311
|
+
osdep_packages = osdep_packages.to_set - installed_packages
|
312
|
+
return if osdep_packages.empty?
|
313
313
|
|
314
|
-
|
315
|
-
filter_options options, install_only: !Autobuild.do_update
|
316
|
-
setup_package_managers(options)
|
314
|
+
setup_package_managers(**options)
|
317
315
|
|
318
|
-
packages = os_package_resolver.resolve_os_packages(
|
316
|
+
packages = os_package_resolver.resolve_os_packages(osdep_packages)
|
319
317
|
packages = packages.map do |handler_name, list|
|
320
318
|
if manager = package_managers[handler_name]
|
321
319
|
[package_managers[handler_name], list]
|
@@ -324,28 +322,24 @@ def install(packages, options = Hash.new)
|
|
324
322
|
end
|
325
323
|
end
|
326
324
|
|
327
|
-
needs_filter = (filter_uptodate_packages? || filter_options[:install_only])
|
328
|
-
packages = packages.map do |handler, list|
|
329
|
-
if needs_filter && handler.respond_to?(:filter_uptodate_packages)
|
330
|
-
list = handler.filter_uptodate_packages(list, filter_options)
|
331
|
-
end
|
332
|
-
|
333
|
-
if !list.empty?
|
334
|
-
[handler, list]
|
335
|
-
end
|
336
|
-
end.compact
|
337
|
-
return false if packages.empty?
|
338
|
-
|
339
325
|
# Install OS packages first, as the other package handlers might
|
340
326
|
# depend on OS packages
|
341
|
-
os_packages, other_packages = packages.partition
|
327
|
+
os_packages, other_packages = packages.partition do |handler, list|
|
328
|
+
handler == os_package_manager
|
329
|
+
end
|
342
330
|
[os_packages, other_packages].each do |packages|
|
343
331
|
packages.each do |handler, list|
|
344
|
-
handler
|
345
|
-
|
332
|
+
list = list.to_set - installed_resolved_packages[handler]
|
333
|
+
next if list.empty?
|
334
|
+
|
335
|
+
handler.install(
|
336
|
+
list.to_a,
|
337
|
+
filter_uptodate_packages: filter_uptodate_packages?,
|
338
|
+
install_only: install_only)
|
339
|
+
installed_resolved_packages[handler].merge(list)
|
346
340
|
end
|
347
341
|
end
|
348
|
-
|
342
|
+
installed_packages.merge(packages)
|
349
343
|
end
|
350
344
|
end
|
351
345
|
end
|
@@ -14,7 +14,7 @@ def initialize(ws, status_file = "/var/lib/dpkg/status")
|
|
14
14
|
|
15
15
|
# On a dpkg-enabled system, checks if the provided package is installed
|
16
16
|
# and returns true if it is the case
|
17
|
-
def installed?(package_name)
|
17
|
+
def installed?(package_name, filter_uptodate_packages: false, install_only: false)
|
18
18
|
if !@installed_packages
|
19
19
|
@installed_packages = Set.new
|
20
20
|
dpkg_status = File.readlines(status_file)
|
@@ -51,19 +51,19 @@ def installed?(package_name)
|
|
51
51
|
end
|
52
52
|
end
|
53
53
|
|
54
|
-
def install(packages)
|
55
|
-
if
|
54
|
+
def install(packages, filter_uptodate_packages: false, install_only: false)
|
55
|
+
if filter_uptodate_packages || install_only
|
56
|
+
packages = packages.find_all do |package_name|
|
57
|
+
!installed?(package_name)
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
if super(packages)
|
56
62
|
# Invalidate caching of installed packages, as we just
|
57
63
|
# installed new packages !
|
58
64
|
@installed_packages = nil
|
59
65
|
end
|
60
66
|
end
|
61
|
-
|
62
|
-
def filter_uptodate_packages(packages, options = Hash.new)
|
63
|
-
packages.find_all do |package_name|
|
64
|
-
!installed?(package_name)
|
65
|
-
end
|
66
|
-
end
|
67
67
|
end
|
68
68
|
end
|
69
69
|
end
|
@@ -37,6 +37,12 @@ def initialize_environment
|
|
37
37
|
env.add_path 'PATH', File.join(ws.dot_autoproj_dir, 'autoproj', 'bin')
|
38
38
|
env.set 'GEM_HOME', config.gems_gem_home
|
39
39
|
|
40
|
+
root_dir = File.join(ws.prefix_dir, 'gems')
|
41
|
+
gemfile_path = File.join(root_dir, 'Gemfile')
|
42
|
+
if File.file?(gemfile_path)
|
43
|
+
env.set('BUNDLE_GEMFILE', gemfile_path)
|
44
|
+
end
|
45
|
+
|
40
46
|
if !config.private_bundler? || !config.private_autoproj? || !config.private_gems?
|
41
47
|
env.set('GEM_PATH', *Gem.default_path)
|
42
48
|
end
|
@@ -154,7 +160,7 @@ def self.run_bundler_install(ws, gemfile, *options, update: true, binstubs: nil)
|
|
154
160
|
end
|
155
161
|
end
|
156
162
|
|
157
|
-
def install(gems)
|
163
|
+
def install(gems, filter_uptodate_packages: false, install_only: false)
|
158
164
|
root_dir = File.join(ws.prefix_dir, 'gems')
|
159
165
|
gemfile_path = File.join(root_dir, 'Gemfile')
|
160
166
|
gemfile_lock_path = "#{gemfile_path}.lock"
|
@@ -179,22 +185,29 @@ def install(gems)
|
|
179
185
|
end
|
180
186
|
end
|
181
187
|
# In addition, look into overrides.d
|
182
|
-
Dir.glob(File.join(ws.
|
188
|
+
Dir.glob(File.join(ws.overrides_dir, "*.gemfile")) do |gemfile_path|
|
183
189
|
gemfiles << gemfile_path
|
184
190
|
end
|
185
191
|
|
186
192
|
# Generate the gemfile and remove the lockfile
|
187
|
-
|
193
|
+
gemfile_lines = gems.map do |name|
|
188
194
|
name, version = parse_package_entry(name)
|
189
195
|
"gem \"#{name}\", \"#{version || ">= 0"}\""
|
190
|
-
end
|
196
|
+
end
|
197
|
+
gemfiles.each do |gemfile|
|
198
|
+
gemfile_lines.concat(File.readlines(gemfile).map(&:chomp))
|
199
|
+
end
|
200
|
+
gemfile_lines = gemfile_lines.sort.uniq
|
201
|
+
gemfile_contents = [
|
202
|
+
"eval_gemfile \"#{File.join(ws.dot_autoproj_dir, 'autoproj', 'Gemfile')}\"",
|
203
|
+
*gemfile_lines
|
204
|
+
].join("\n")
|
205
|
+
|
191
206
|
FileUtils.mkdir_p root_dir
|
192
|
-
File.
|
193
|
-
|
194
|
-
|
195
|
-
io.puts File.read(gemfile)
|
207
|
+
if updated = (!File.exist?(gemfile_path) || File.read(gemfile_path) != gemfile_contents)
|
208
|
+
File.open(gemfile_path, 'w') do |io|
|
209
|
+
io.puts gemfile_contents
|
196
210
|
end
|
197
|
-
io.puts gems
|
198
211
|
end
|
199
212
|
|
200
213
|
options = Array.new
|
@@ -203,8 +216,10 @@ def install(gems)
|
|
203
216
|
end
|
204
217
|
|
205
218
|
binstubs_path = File.join(root_dir, 'bin')
|
206
|
-
|
207
|
-
|
219
|
+
if updated || !install_only || !File.file?("#{gemfile_path}.lock")
|
220
|
+
self.class.run_bundler_install ws, gemfile_path, *options,
|
221
|
+
binstubs: binstubs_path
|
222
|
+
end
|
208
223
|
|
209
224
|
if bundle_rubylib = discover_bundle_rubylib
|
210
225
|
update_env_rubylib(bundle_rubylib)
|
@@ -10,7 +10,7 @@ def initialize(ws)
|
|
10
10
|
false)
|
11
11
|
end
|
12
12
|
|
13
|
-
def filter_uptodate_packages(packages
|
13
|
+
def filter_uptodate_packages(packages)
|
14
14
|
# TODO there might be duplicates in packages which should be fixed
|
15
15
|
# somewhere else
|
16
16
|
packages = packages.uniq
|
@@ -38,6 +38,13 @@ def filter_uptodate_packages(packages, options = Hash.new)
|
|
38
38
|
end
|
39
39
|
new_packages
|
40
40
|
end
|
41
|
+
|
42
|
+
def install(packages, filter_uptodate_packages: true, install_only: false)
|
43
|
+
if filter_uptodate_packages || install_only
|
44
|
+
packages = filter_uptodate_packages(packages)
|
45
|
+
end
|
46
|
+
super(packages)
|
47
|
+
end
|
41
48
|
end
|
42
49
|
end
|
43
50
|
end
|
@@ -108,8 +108,7 @@ def initialize(ws, needs_locking, user_install_cmd, auto_install_cmd,needs_root=
|
|
108
108
|
# command-line pattern that should be used to generate the script.
|
109
109
|
# If given, it overrides the default value stored in
|
110
110
|
# {#user_install_cmd]
|
111
|
-
def generate_user_os_script(os_packages,
|
112
|
-
user_install_cmd = options[:user_install_cmd] || self.user_install_cmd
|
111
|
+
def generate_user_os_script(os_packages, user_install_cmd: self.user_install_cmd)
|
113
112
|
if user_install_cmd
|
114
113
|
(user_install_cmd % [os_packages.join("' '")])
|
115
114
|
else generate_auto_os_script(os_packages)
|
@@ -125,8 +124,7 @@ def generate_user_os_script(os_packages, options = Hash.new)
|
|
125
124
|
# command-line pattern that should be used to generate the script.
|
126
125
|
# If given, it overrides the default value stored in
|
127
126
|
# {#auto_install_cmd]
|
128
|
-
def generate_auto_os_script(os_packages,
|
129
|
-
auto_install_cmd = options[:auto_install_cmd] || self.auto_install_cmd
|
127
|
+
def generate_auto_os_script(os_packages, auto_install_cmd: self.auto_install_cmd)
|
130
128
|
(auto_install_cmd % [os_packages.join("' '")])
|
131
129
|
end
|
132
130
|
|
@@ -183,11 +181,14 @@ def osdeps_interaction(os_packages, shell_script)
|
|
183
181
|
# command line that should be used by autoproj to install said
|
184
182
|
# packages. See the option in {#generate_auto_os_script}
|
185
183
|
# @return [Boolean] true if packages got installed, false otherwise
|
186
|
-
def install(packages,
|
184
|
+
def install(packages, filter_uptodate_packages: false, install_only: false,
|
185
|
+
auto_install_cmd: self.auto_install_cmd, user_install_cmd: self.user_install_cmd)
|
186
|
+
return if packages.empty?
|
187
|
+
|
187
188
|
handled_os = ws.supported_operating_system?
|
188
189
|
if handled_os
|
189
|
-
shell_script = generate_auto_os_script(packages,
|
190
|
-
user_shell_script = generate_user_os_script(packages,
|
190
|
+
shell_script = generate_auto_os_script(packages, auto_install_cmd: auto_install_cmd)
|
191
|
+
user_shell_script = generate_user_os_script(packages, user_install_cmd: user_install_cmd)
|
191
192
|
end
|
192
193
|
if osdeps_interaction(packages, user_shell_script)
|
193
194
|
Autoproj.message " installing OS packages: #{packages.sort.join(", ")}"
|
@@ -8,7 +8,7 @@ def initialize(ws)
|
|
8
8
|
"yum install -y '%s'")
|
9
9
|
end
|
10
10
|
|
11
|
-
def filter_uptodate_packages(packages
|
11
|
+
def filter_uptodate_packages(packages)
|
12
12
|
result = `LANG=C rpm -q --queryformat "%{NAME}\n" '#{packages.join("' '")}'`
|
13
13
|
|
14
14
|
installed_packages = []
|
@@ -32,14 +32,18 @@ def filter_uptodate_packages(packages, options = Hash.new)
|
|
32
32
|
new_packages
|
33
33
|
end
|
34
34
|
|
35
|
-
def install(packages)
|
35
|
+
def install(packages, filter_uptodate_packages: false, install_only: false)
|
36
|
+
if filter_uptodate_packages
|
37
|
+
packages = filter_uptodate_packages(packages)
|
38
|
+
end
|
39
|
+
|
36
40
|
patterns, packages = packages.partition { |pkg| pkg =~ /^@/ }
|
37
41
|
patterns = patterns.map { |str| str[1..-1] }
|
38
42
|
result = false
|
39
43
|
if !patterns.empty?
|
40
44
|
result |= super(patterns,
|
41
|
-
:
|
42
|
-
:
|
45
|
+
auto_install_cmd: "yum groupinstall -y '%s'",
|
46
|
+
user_install_cmd: "yum groupinstall '%s'")
|
43
47
|
end
|
44
48
|
if !packages.empty?
|
45
49
|
result |= super(packages)
|
@@ -8,7 +8,7 @@ def initialize(ws)
|
|
8
8
|
"zypper -n install '%s'")
|
9
9
|
end
|
10
10
|
|
11
|
-
def filter_uptodate_packages(packages
|
11
|
+
def filter_uptodate_packages(packages)
|
12
12
|
result = `LANG=C rpm -q --whatprovides '#{packages.join("' '")}'`
|
13
13
|
has_all_pkgs = $?.success?
|
14
14
|
|
@@ -19,14 +19,18 @@ def filter_uptodate_packages(packages, options = Hash.new)
|
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
22
|
-
def install(packages)
|
22
|
+
def install(packages, filter_uptodate_packages: false, install_only: false)
|
23
|
+
if filter_uptodate_packages || install_only
|
24
|
+
packages = filter_uptodate_packages(packages)
|
25
|
+
end
|
26
|
+
|
23
27
|
patterns, packages = packages.partition { |pkg| pkg =~ /^@/ }
|
24
28
|
patterns = patterns.map { |str| str[1..-1] }
|
25
29
|
result = false
|
26
30
|
if !patterns.empty?
|
27
31
|
result |= super(patterns,
|
28
|
-
:
|
29
|
-
:
|
32
|
+
auto_install_cmd: "zypper --non-interactive install --type pattern '%s'",
|
33
|
+
user_install_cmd: "zypper install --type pattern '%s'")
|
30
34
|
end
|
31
35
|
if !packages.empty?
|
32
36
|
result |= super(packages)
|
data/lib/autoproj/version.rb
CHANGED
data/lib/autoproj/workspace.rb
CHANGED
@@ -298,7 +298,7 @@ def update_autoproj(restart_on_update: true)
|
|
298
298
|
|
299
299
|
# Find out what version of autoproj bundler locked on
|
300
300
|
autoproj = File.readlines("#{gemfile}.lock").
|
301
|
-
find_all { |l| l =~ /^\s+autoproj \(.*\)$/ }
|
301
|
+
find_all { |l| l =~ /^\s+autoproj \(\d.*\)$/ }
|
302
302
|
if autoproj.size == 1
|
303
303
|
autoproj[0] =~ /^\s+autoproj \((.*)\)$/
|
304
304
|
installed_version = $1
|
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.0.0.
|
4
|
+
version: 2.0.0.rc11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sylvain Joyeux
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-10-
|
11
|
+
date: 2015-10-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: autobuild
|