autoproj 2.0.0.rc40 → 2.0.0.rc41

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2a07dcff0dd83e7effa40c2e49cb6e7c787b8e91
4
- data.tar.gz: 10d415d8951ffd95569ecdcceb6e57b21bc5f50d
3
+ metadata.gz: 0d0b20db732502f99f80c293de6b432fa3efb44e
4
+ data.tar.gz: 5b94a0795ead67203aa0fb9a75b0c8539d94b88e
5
5
  SHA512:
6
- metadata.gz: 9e5dbc3159967f110d135b2a698ddfac4832ad19c7c6155c80dd3a9d45d7118563bec8e7e035c75b39f5110a2d39242290f01eb9a0a64733a68e4b499fa55c83
7
- data.tar.gz: ad22069f7b21df19a71daf6e0e9c6b1c58c875b8883645dd04e35fb3f5c6a13285ce9054de2dbc74f852f322877fc6808601513f0f0f88f5e3a70e4ad8c005d8
6
+ metadata.gz: e83690a10494761eb928876a783bc0dbe42468cdb46e4a9ff24a70b1d24164fb351adca407bea5cd506fd883c1f950b14a7789915058d79f6c12c5a4f3e04947
7
+ data.tar.gz: 79a383acbd91e887bf26912ac9a375f563a4881f125dad49cc2df58c66a762afb02c74ed16bb06d175c5e9c39a55b24396f93a065d06b0ceb4de31373f4f0e74
data/autoproj.gemspec CHANGED
@@ -17,7 +17,7 @@ Gem::Specification.new do |s|
17
17
 
18
18
  s.required_ruby_version = ">= 2.0.0"
19
19
  s.bindir = 'bin'
20
- s.executables = ['autoproj', 'aup', 'amake', 'alocate']
20
+ s.executables = ['autoproj', 'aup', 'amake', 'alocate', 'alog']
21
21
  s.require_paths = ["lib"]
22
22
  s.extensions = []
23
23
  s.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
data/bin/alog ADDED
@@ -0,0 +1,25 @@
1
+ #! /usr/bin/env ruby
2
+
3
+ require 'autoproj/cli/main'
4
+ require 'autoproj/cli/locate'
5
+
6
+ Autoproj::CLI.basic_setup
7
+ Autoproj.report(silent: true) do
8
+ cli = Autoproj::CLI::Locate.new
9
+
10
+ arg = ARGV.first || Dir.pwd
11
+ if File.directory?(arg)
12
+ arg = "#{File.expand_path(arg)}/"
13
+ end
14
+ log_files = cli.logs_of(arg, log: nil)
15
+
16
+ if log_files.size == 1
17
+ logfile = log_files.first
18
+ elsif log_files.size > 1
19
+ logfile = cli.select_log_file(log_files)
20
+ elsif log_files.empty?
21
+ raise "no logs found for #{string}"
22
+ end
23
+
24
+ puts File.read(logfile)
25
+ end
@@ -45,7 +45,9 @@ def format_package(format, priority, package)
45
45
  autobuild_package = package.autobuild
46
46
  fields = Hash.new
47
47
  fields['SRCDIR'] = autobuild_package.srcdir
48
- fields['BUILDDIR'] = autobuild_package.builddir
48
+ fields['BUILDDIR'] = if autobuild_package.respond_to?(:builddir)
49
+ autobuild_package.builddir
50
+ end
49
51
  fields['PREFIX'] = autobuild_package.prefix
50
52
  fields['NAME'] = package.name
51
53
  fields['PRIORITY'] = priority
@@ -20,17 +20,24 @@ def run(user_selection, short: false, recursive: false, mainline: false, env: fa
20
20
  source_packages, osdep_packages = Array.new, Array.new
21
21
  end
22
22
 
23
- if package_set_names.empty? && source_packages.empty? && osdep_packages.empty?
23
+ all_matching_osdeps = osdep_packages.map { |pkg| [pkg, true] }
24
+ user_selection.each do |sel|
25
+ if !osdep_packages.include?(sel) && ws.os_package_resolver.all_definitions.has_key?(sel)
26
+ all_matching_osdeps << [sel, false]
27
+ end
28
+ end
29
+
30
+ if package_set_names.empty? && source_packages.empty? && all_matching_osdeps.empty?
24
31
  Autoproj.error "no package set, packages or OS packages match #{user_selection.join(" ")}"
25
32
  return
26
- elsif !source_packages.empty? || !osdep_packages.empty?
33
+ elsif !source_packages.empty? || !all_matching_osdeps.empty?
27
34
  load_all_available_package_manifests
28
35
  revdeps = ws.manifest.compute_revdeps
29
36
  end
30
37
 
31
38
  package_set_names = package_set_names.sort
32
39
  source_packages = source_packages.sort
33
- osdep_packages = osdep_packages.sort
40
+ all_matching_osdeps = all_matching_osdeps.sort_by { |name, _| name }
34
41
 
35
42
  if short
36
43
  package_set_names.each do |name|
@@ -39,8 +46,8 @@ def run(user_selection, short: false, recursive: false, mainline: false, env: fa
39
46
  source_packages.each do |name|
40
47
  puts "pkg #{name}"
41
48
  end
42
- osdep_packages.each do |name|
43
- puts "osdep #{name}"
49
+ all_matching_osdeps.each do |name, sel|
50
+ puts "osdep #{name} (#{sel ? "not selected" : "selected"})"
44
51
  end
45
52
  else
46
53
  package_set_names.each do |pkg_set_name|
@@ -49,8 +56,8 @@ def run(user_selection, short: false, recursive: false, mainline: false, env: fa
49
56
  source_packages.each do |pkg_name|
50
57
  display_source_package(pkg_name, default_packages, revdeps, env: env)
51
58
  end
52
- osdep_packages.each do |pkg_name|
53
- display_osdep_package(pkg_name, default_packages, revdeps)
59
+ all_matching_osdeps.each do |pkg_name, selected|
60
+ display_osdep_package(pkg_name, default_packages, revdeps, selected)
54
61
  end
55
62
  end
56
63
  end
@@ -160,12 +167,31 @@ def display_vcs(vcs)
160
167
  end
161
168
  end
162
169
 
163
- def display_osdep_package(pkg_name, default_packages, revdeps)
170
+ def display_osdep_package(pkg_name, default_packages, revdeps, selected)
164
171
  puts Autoproj.color("the osdep '#{pkg_name}'", :bold)
165
- ws.os_package_resolver.resolve_os_packages([pkg_name]).each do |manager_name, packages|
166
- puts " #{manager_name}: #{packages.map { |*subnames| subnames.join(" ") }.join(", ")}"
172
+ begin
173
+ ws.os_package_resolver.resolve_os_packages([pkg_name]).each do |manager_name, packages|
174
+ puts " #{manager_name}: #{packages.map { |*subnames| subnames.join(" ") }.join(", ")}"
175
+ end
176
+ rescue MissingOSDep => e
177
+ puts " #{e.message}"
167
178
  end
168
179
 
180
+ if !selected
181
+ puts " is present, but won't be used by autoproj for '#{pkg_name}'"
182
+ end
183
+
184
+ entries = ws.os_package_resolver.all_definitions[pkg_name]
185
+ puts " #{entries.inject(0) { |c, (files, _)| c + files.size }} matching entries:"
186
+ entries.each do |files, entry|
187
+ puts " in #{files.join(", ")}:"
188
+ lines = YAML.dump(entry).split("\n")
189
+ lines[0] = lines[0].gsub(/---\s*/, '')
190
+ if lines[0].empty?
191
+ lines.shift
192
+ end
193
+ puts " " + lines.join("\n ")
194
+ end
169
195
  display_common_information(pkg_name, default_packages, revdeps)
170
196
  end
171
197
 
@@ -1,7 +1,7 @@
1
1
  module Autoproj
2
2
  # Manifest of installed packages imported from another autoproj installation
3
3
  class InstallationManifest
4
- Package = Struct.new :name, :srcdir, :prefix, :builddir, :dependencies
4
+ Package = Struct.new :name, :srcdir, :prefix, :builddir, :logdir, :dependencies
5
5
  PackageSet = Struct.new :name, :raw_local_dir, :user_local_dir
6
6
 
7
7
  attr_reader :path
@@ -52,7 +52,7 @@ def load
52
52
  else
53
53
  pkg = Package.new(
54
54
  entry['name'], entry['srcdir'], entry['prefix'],
55
- entry['builddir'], entry['dependencies'])
55
+ entry['builddir'], entry['logdir'], entry['dependencies'])
56
56
  packages[pkg.name] = pkg
57
57
  end
58
58
  end
@@ -72,6 +72,7 @@ def save(path = self.path)
72
72
  Hash['name' => v.name,
73
73
  'srcdir' => v.srcdir,
74
74
  'builddir' => (v.builddir if v.respond_to?(:builddir)),
75
+ 'logdir' => v.logdir,
75
76
  'prefix' => v.prefix,
76
77
  'dependencies' => v.dependencies]
77
78
  end
data/lib/autoproj/test.rb CHANGED
@@ -315,8 +315,8 @@ def ws_add_metapackage_to_layout(name, *packages)
315
315
  meta
316
316
  end
317
317
 
318
- def ws_define_osdep_entries(entries)
319
- ws_os_package_resolver.add_entries(entries)
318
+ def ws_define_osdep_entries(entries, file: nil)
319
+ ws_os_package_resolver.add_entries(entries, file: file)
320
320
  end
321
321
 
322
322
  def ws_add_osdep_entries_to_layout(entries)
@@ -1,3 +1,3 @@
1
1
  module Autoproj
2
- VERSION = "2.0.0.rc40"
2
+ VERSION = "2.0.0.rc41"
3
3
  end
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.rc40
4
+ version: 2.0.0.rc41
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sylvain Joyeux
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-20 00:00:00.000000000 Z
11
+ date: 2016-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -191,6 +191,7 @@ executables:
191
191
  - aup
192
192
  - amake
193
193
  - alocate
194
+ - alog
194
195
  extensions: []
195
196
  extra_rdoc_files: []
196
197
  files:
@@ -203,6 +204,7 @@ files:
203
204
  - Rakefile
204
205
  - autoproj.gemspec
205
206
  - bin/alocate
207
+ - bin/alog
206
208
  - bin/amake
207
209
  - bin/aup
208
210
  - bin/autoproj