autoproj 1.9.7.rc20 → 1.9.7.rc21

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,12 +5,32 @@ require 'autoproj/cmdline'
5
5
 
6
6
  pwd = Dir.pwd
7
7
  root_dir = Autoproj::CmdLine.initialize_root_directory
8
- selection = Autoproj::CmdLine.initialize_and_load(ARGV)
8
+ Autoproj.silent do
9
+ Autoproj::CmdLine.initialize_and_load([])
10
+ end
11
+
12
+ parser = OptionParser.new do |opt|
13
+ opt.banner = ['autoproj create-set path [package package ..]',
14
+ '',
15
+ 'Creates a new package set that includes the given packages',
16
+ 'Packages can be already defined in other package sets',
17
+ 'or (more commonly) paths to checked out packages on disk',
18
+ '',
19
+ 'The path argument is the path where the package set should',
20
+ 'be created. The basename will be used as the package set name',
21
+ 'For instance,',
22
+ ' autoproj create-set new_set/lead',
23
+ 'Will create a new package set definition in the new_set/lead',
24
+ 'directory. The new set will be named "lead"'].join("\n")
25
+
26
+ end
27
+ user_selection = parser.parse(ARGV)
9
28
 
10
- if !(new_set_path = File.expand_path(selection.shift, pwd))
11
- Autoproj.message("missing package set name on the command line", :red)
29
+ if !(new_set_path = user_selection.shift)
30
+ Autoproj.message("missing path to the generated package set on the command line", :red)
12
31
  exit 1
13
32
  end
33
+ new_set_path = File.expand_path(new_set_path, pwd)
14
34
  new_set_name = File.basename(new_set_path)
15
35
  selection = Autoproj::CmdLine.resolve_user_selection(user_selection)
16
36
  Autoproj::CmdLine.validate_user_selection(user_selection, selection)
@@ -55,8 +75,19 @@ puts
55
75
  puts
56
76
  new_packages.each do |pkg|
57
77
  if !pkg.vcs
58
- puts " package #{pkg.autobuild.name} has no version control information"
59
- puts " you will have to provide this in the generated source.yml file"
78
+ # Try to autodetect the VCS
79
+ srcdir = pkg.autobuild.srcdir
80
+ handler = [Autobuild::Git].find do |vcs_handler|
81
+ vcs_handler.can_handle?(srcdir)
82
+ end
83
+ if handler
84
+ raw_vcs = handler.vcs_definition_for(srcdir)
85
+ pkg.vcs = Autoproj::VCSDefinition.from_raw(raw_vcs)
86
+ else
87
+ puts " package #{pkg.autobuild.name} has no version control information"
88
+ puts " and I am not able to autodetect it."
89
+ puts " you will have to provide this in the generated source.yml file"
90
+ end
60
91
  end
61
92
  end
62
93
 
@@ -1,7 +1,7 @@
1
1
  #! /usr/bin/ruby
2
2
 
3
- if RUBY_VERSION < "1.8.7"
4
- STDERR.puts "autoproj requires Ruby >= 1.8.7"
3
+ if RUBY_VERSION < "1.9.3"
4
+ STDERR.puts "autoproj requires Ruby >= 1.9.3"
5
5
  exit 1
6
6
  end
7
7
 
@@ -126,6 +126,7 @@ module Autobuild
126
126
  end
127
127
 
128
128
  require 'tempfile'
129
+ require 'json'
129
130
  module Autoproj
130
131
  # Module that contains the package manager implementations for the
131
132
  # OSDependencies class
@@ -572,6 +573,7 @@ fi
572
573
  is_installed = false
573
574
  dpkg_status.each do |line|
574
575
  line = line.chomp
576
+ line = line.encode( "UTF-8", "binary", :invalid => :replace, :undef => :replace)
575
577
  if line == ""
576
578
  if is_installed
577
579
  current_packages.each do |pkg|
@@ -2520,7 +2522,7 @@ ruby19:
2520
2522
  - ruby19
2521
2523
  - rake
2522
2524
  macos-brew:
2523
- - ruby193
2525
+ - gem: rake
2524
2526
  default: nonexistent
2525
2527
  opensuse: ruby19-devel
2526
2528
  arch: ignore
@@ -2537,6 +2539,8 @@ ruby20:
2537
2539
  - rubygem-rake
2538
2540
  opensuse: ruby20-devel
2539
2541
  arch: ignore
2542
+ macos-brew:
2543
+ - gem: rake
2540
2544
  default: nonexistent
2541
2545
  ruby21:
2542
2546
  debian:
@@ -2546,6 +2550,8 @@ ruby21:
2546
2550
  - rubygems-integration
2547
2551
  arch: ignore
2548
2552
  fedora: ruby-devel
2553
+ macos-brew:
2554
+ - gem: rake
2549
2555
  default: nonexistent
2550
2556
  build-essential:
2551
2557
  debian,ubuntu: build-essential
@@ -1,7 +1,7 @@
1
1
  #! /usr/bin/ruby
2
2
 
3
- if RUBY_VERSION < "1.8.7"
4
- STDERR.puts "autoproj requires Ruby >= 1.8.7"
3
+ if RUBY_VERSION < "1.9.3"
4
+ STDERR.puts "autoproj requires Ruby >= 1.9.3"
5
5
  exit 1
6
6
  end
7
7
 
data/lib/autoproj.rb CHANGED
@@ -19,7 +19,6 @@ require 'autoproj/cmdline'
19
19
  require 'autoproj/query'
20
20
  require 'logger'
21
21
  require 'utilrb/logger'
22
- require 'json'
23
22
 
24
23
  module Autoproj
25
24
  class << self
@@ -36,7 +36,7 @@ ruby19:
36
36
  - ruby19
37
37
  - rake
38
38
  macos-brew:
39
- - ruby193
39
+ - gem: rake
40
40
  default: nonexistent
41
41
  opensuse: ruby19-devel
42
42
  arch: ignore # on arch, if ruby is installed then so is the supporting stuff
@@ -55,6 +55,8 @@ ruby20:
55
55
  - rubygem-rake
56
56
  opensuse: ruby20-devel
57
57
  arch: ignore # on arch, if ruby is installed then so is the supporting stuff
58
+ macos-brew:
59
+ - gem: rake
58
60
  default: nonexistent
59
61
 
60
62
  ruby21:
@@ -65,6 +67,8 @@ ruby21:
65
67
  - rubygems-integration
66
68
  arch: ignore # on arch, if ruby is installed then so is the supporting stuff
67
69
  fedora: ruby-devel
70
+ macos-brew:
71
+ - gem: rake
68
72
  default: nonexistent
69
73
 
70
74
  build-essential:
@@ -1,4 +1,5 @@
1
1
  require 'tempfile'
2
+ require 'json'
2
3
  module Autoproj
3
4
  # Module that contains the package manager implementations for the
4
5
  # OSDependencies class
@@ -445,6 +446,7 @@ fi
445
446
  is_installed = false
446
447
  dpkg_status.each do |line|
447
448
  line = line.chomp
449
+ line = line.encode( "UTF-8", "binary", :invalid => :replace, :undef => :replace)
448
450
  if line == ""
449
451
  if is_installed
450
452
  current_packages.each do |pkg|
@@ -1,3 +1,3 @@
1
1
  module Autoproj
2
- VERSION = "1.9.7.rc20"
2
+ VERSION = "1.9.7.rc21"
3
3
  end
@@ -11,6 +11,15 @@ class TC_OSDependencies_AptDpkgManager < Test::Unit::TestCase
11
11
  assert !mng.installed?('noninstalled-package')
12
12
  end
13
13
 
14
+ def test_status_file_parsing_is_robust_to_invalid_utf8
15
+ Tempfile.open 'osdeps_aptdpkg' do |io|
16
+ io.puts "Package: \x80\nStatus: installed ok install\n\nPackage: installed\nStatus: installed ok install"
17
+ io.flush
18
+ mng = Autoproj::PackageManagers::AptDpkgManager.new(io.path)
19
+ mng.installed?('installed')
20
+ end
21
+ end
22
+
14
23
  def test_status_file_parsing_last_entry_installed
15
24
  file = File.expand_path("apt-dpkg-status.installed-last", File.dirname(__FILE__))
16
25
  mng = Autoproj::PackageManagers::AptDpkgManager.new(file)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: autoproj
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.7.rc20
4
+ version: 1.9.7.rc21
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-05-27 00:00:00.000000000 Z
12
+ date: 2014-05-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: autobuild