autoproj 2.10.1 → 2.10.2

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
  SHA256:
3
- metadata.gz: 5dca8e55a7c64c7312807af77109ad2c9cd0595a9a9a1d71380feaf94adfedc8
4
- data.tar.gz: 82839629e2b0d4f88fd164b9ebb918d43e59b14d6405914a7d0a125f2d704d8a
3
+ metadata.gz: 9816c7630ddb1758579428da56d50fcfd6e655ff69d9daddbe860c4f8d8c9501
4
+ data.tar.gz: ec2228ff0857f8a4d78fc7ee512a6ec50c2b02dec8bc15af725a43b8a97ddf31
5
5
  SHA512:
6
- metadata.gz: 3df68134467944f00613b7618a4ef0549ae1e96b8c0da30aa0c4e6303cd8f6fa8a5ada7718a6e1521ca2385b951c803cd475b0c9dd298eae5f012057e8f57cc3
7
- data.tar.gz: cc986e111da204e047f11e4d1e9fcdf13de55220b5bfc164e9494c1ad1facd5094796e3cb9e325ba6dd97d1034cfda749fc5fc56e9b284b42e819ca4c01ebb47
6
+ metadata.gz: 362c3cc73ce68418dc18fa0f018523de0a0b0ea27f6f72fc56d7cf8c820dae1d1eacdf759bae614ad5bf547973a44f6e7cadbe1863df1d75fc2673cec124c855
7
+ data.tar.gz: 877354416b6ab05061f99c630ea535aeb6cbabd529682a0b85d051567687a58430e49b4b4c2c61f857edcc193d6220c202972f0deadd2ba59d0bd42ada907ff6
@@ -535,7 +535,9 @@ def parse_source_definition(source_definition)
535
535
 
536
536
  Autoproj.in_file(source_file) do
537
537
  default_vcs_spec, raw = version_control_field(
538
- 'default', version_control, file: source_file)
538
+ 'default', version_control,
539
+ file: source_file, section: 'version_control'
540
+ )
539
541
  if default_vcs_spec
540
542
  @default_importer = VCSDefinition.from_raw(default_vcs_spec,
541
543
  raw: raw, from: self)
@@ -653,28 +655,30 @@ def normalize_vcs_list(section_name, file, list)
653
655
  # package in the form (PackageSet,Hash), where PackageSet is self.
654
656
  # The Hash part is nil if there are no matching entries. Hash keys are
655
657
  # normalized to symbols
656
- def version_control_field(package_name, entry_list, validate: true, file: source_file)
658
+ def version_control_field(package_name, entry_list, validate: true,
659
+ file: source_file, section: nil)
657
660
  raw = []
658
- vcs_spec = Hash.new
661
+ vcs_spec = entry_list.inject({}) do |resolved_spec, (name_match, spec)|
662
+ next(resolved_spec) unless name_match === package_name
659
663
 
660
- entry_list.each do |name_match, spec|
661
- if name_match === package_name
662
- raw << VCSDefinition::RawEntry.new(self, file, spec)
663
- vcs_spec =
664
- begin
665
- VCSDefinition.update_raw_vcs_spec(vcs_spec, spec)
666
- rescue ConfigError => e
667
- raise ConfigError.new, "invalid VCS definition in the #{section_name} section for '#{name}': #{e.message}", e.backtrace
668
- end
664
+ raw << VCSDefinition::RawEntry.new(self, file, spec)
665
+ begin
666
+ VCSDefinition.update_raw_vcs_spec(resolved_spec, spec)
667
+ rescue ArgumentError => e
668
+ raise ConfigError.new,
669
+ 'invalid VCS definition while resolving package '\
670
+ "'#{package_name}', entry '#{name_match}' of "\
671
+ "#{section ? "section '#{section}'" : ''}: "\
672
+ "#{e.message}", e.backtrace
669
673
  end
670
674
  end
671
675
 
672
- if vcs_spec.empty?
673
- return nil, []
674
- end
676
+ return nil, [] if vcs_spec.empty?
675
677
 
676
- expansions = Hash["PACKAGE" => package_name,
677
- "PACKAGE_BASENAME" => File.basename(package_name)]
678
+ expansions = {
679
+ 'PACKAGE' => package_name,
680
+ 'PACKAGE_BASENAME' => File.basename(package_name)
681
+ }
678
682
 
679
683
  vcs_spec = expand(vcs_spec, expansions)
680
684
  vcs_spec.dup.each do |name, value|
@@ -682,7 +686,7 @@ def version_control_field(package_name, entry_list, validate: true, file: source
682
686
  end
683
687
 
684
688
  # Resolve relative paths w.r.t. the workspace root dir
685
- if url = (vcs_spec.delete('url') || vcs_spec.delete(:url))
689
+ if (url = (vcs_spec.delete('url') || vcs_spec.delete(:url)))
686
690
  vcs_spec[:url] = VCSDefinition.to_absolute_url(url, ws.root_dir)
687
691
  end
688
692
 
@@ -691,11 +695,14 @@ def version_control_field(package_name, entry_list, validate: true, file: source
691
695
  if validate
692
696
  begin
693
697
  VCSDefinition.from_raw(vcs_spec)
694
- rescue ConfigError => e
695
- raise ConfigError.new, "invalid resulting VCS definition for package #{package_name}: #{e.message}", e.backtrace
698
+ rescue ArgumentError => e
699
+ raise ConfigError.new,
700
+ 'invalid resulting VCS definition for package '\
701
+ "'#{package_name}': #{e.message}",
702
+ e.backtrace
696
703
  end
697
704
  end
698
- return vcs_spec, raw
705
+ [vcs_spec, raw]
699
706
  end
700
707
 
701
708
  # @api private
@@ -706,15 +713,20 @@ def invalidate_importer_definitions_cache
706
713
  end
707
714
 
708
715
  # Returns the VCS definition for +package_name+ as defined in this
709
- # source, or nil if the source does not have any.
716
+ # package set, or nil if the source does not have any.
710
717
  #
711
718
  # @param [PackageDefinition] package
712
719
  # @return [VCSDefinition] the importer definition, or nil if none
713
720
  # could be found
714
721
  def importer_definition_for(package, default: default_importer, require_existing: true)
715
- package_name = manifest.validate_package_name_argument(package, require_existing: require_existing)
722
+ package_name = manifest.validate_package_name_argument(
723
+ package, require_existing: require_existing
724
+ )
716
725
  importer_definitions_cache[package_name] ||= Autoproj.in_file source_file do
717
- vcs_spec, raw = version_control_field(package_name, version_control, file: source_file)
726
+ vcs_spec, raw = version_control_field(
727
+ package_name, version_control,
728
+ file: source_file, section: 'version_control'
729
+ )
718
730
  if vcs_spec
719
731
  VCSDefinition.from_raw(vcs_spec, raw: raw, from: self)
720
732
  else
@@ -729,7 +741,9 @@ def importer_definition_for(package, default: default_importer, require_existing
729
741
  # @param [VCSDefinition] the vcs to be updated
730
742
  # @return [VCSDefinition] the new, updated vcs object
731
743
  def overrides_for(package, vcs, require_existing: true)
732
- package_name = manifest.validate_package_name_argument(package, require_existing: require_existing)
744
+ package_name = manifest.validate_package_name_argument(
745
+ package, require_existing: require_existing
746
+ )
733
747
  resolve_overrides(package_name, vcs)
734
748
  end
735
749
 
@@ -742,7 +756,10 @@ def resolve_overrides(key, vcs)
742
756
  overrides.each do |file, file_overrides|
743
757
  new_spec, new_raw_entry =
744
758
  Autoproj.in_file file do
745
- version_control_field(key, file_overrides, validate: false, file: file)
759
+ version_control_field(
760
+ key, file_overrides,
761
+ validate: false, file: file, section: 'overrides'
762
+ )
746
763
  end
747
764
 
748
765
  if new_spec
@@ -750,7 +767,9 @@ def resolve_overrides(key, vcs)
750
767
  begin
751
768
  vcs = vcs.update(new_spec, raw: new_raw_entry, from: self)
752
769
  rescue ConfigError => e
753
- raise ConfigError.new, "invalid resulting VCS specification in the overrides section for #{key}: #{e.message}"
770
+ raise ConfigError.new, "invalid resulting VCS specification "\
771
+ "in the overrides section for "\
772
+ "#{key}: #{e.message}"
754
773
  end
755
774
  end
756
775
  end
@@ -143,7 +143,6 @@ def key_exist?(key)
143
143
  Open3.popen3({'LANG' => 'C'}, 'apt-key', 'export', key) do |_, _, stderr, wait_thr|
144
144
  success = wait_thr.value.success?
145
145
  stderr = stderr.read
146
- puts stderr.inspect
147
146
  has_error = stderr.match(/WARNING: nothing exported/)
148
147
  exist = success && !has_error
149
148
  end
@@ -113,6 +113,8 @@ def self.update_raw_vcs_spec(old, new)
113
113
  #
114
114
  # - package_name
115
115
  # branch: value
116
+ #
117
+ # @raise ArgumentError if the given spec cannot be normalized
116
118
  def self.normalize_vcs_hash(spec, base_dir: nil)
117
119
  plain = Array.new
118
120
  filtered_spec = Hash.new
@@ -130,7 +132,7 @@ def self.normalize_vcs_hash(spec, base_dir: nil)
130
132
  end
131
133
 
132
134
  if plain.size > 1
133
- raise ConfigError.new, "invalid syntax"
135
+ raise ArgumentError, "invalid syntax"
134
136
  elsif plain.size == 1
135
137
  short_url = plain.first
136
138
  vcs, *url = short_url.split(':')
@@ -274,7 +276,7 @@ def create_autobuild_importer
274
276
  end
275
277
 
276
278
  # Returns a pretty representation of this VCS definition
277
- def to_s
279
+ def to_s
278
280
  if type == "none"
279
281
  "none"
280
282
  else
@@ -326,7 +328,7 @@ def self.call_source_handler(vcs, url, options)
326
328
  # - tools/orocos.rb:
327
329
  # github: rock-core/base-types
328
330
  # branch: test
329
- #
331
+ #
330
332
  # @yieldparam [String] url the url given to the handler
331
333
  # @yieldparam [Hash] the rest of the VCS hash
332
334
  # @return [Hash] a VCS hash with the information expanded
@@ -1,3 +1,3 @@
1
1
  module Autoproj
2
- VERSION = "2.10.1"
2
+ VERSION = "2.10.2"
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.10.1
4
+ version: 2.10.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sylvain Joyeux
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-06-03 00:00:00.000000000 Z
11
+ date: 2019-08-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler