autoproj 2.0.0.rc5 → 2.0.0.rc6

Sign up to get free protection for your applications and to get access to all the features.
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.rc5
4
+ version: 2.0.0.rc6
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-08 00:00:00.000000000 Z
11
+ date: 2015-10-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: autobuild
@@ -191,7 +191,6 @@ files:
191
191
  - lib/autoproj/cli/tag.rb
192
192
  - lib/autoproj/cli/test.rb
193
193
  - lib/autoproj/cli/update.rb
194
- - lib/autoproj/cli/upgrade.rb
195
194
  - lib/autoproj/cli/versions.rb
196
195
  - lib/autoproj/configuration.rb
197
196
  - lib/autoproj/default.osdeps
@@ -1,75 +0,0 @@
1
- require 'autoproj/ops/install'
2
- require 'autoproj/find_workspace'
3
- module Autoproj
4
- module CLI
5
- class Upgrade
6
- def upgrade_from_v2(installer, options = Hash.new)
7
- installer.install
8
- end
9
-
10
- def upgrade_from_v1(installer, options = Hash.new)
11
- root_dir = installer.root_dir
12
-
13
- # Save a backup of the existing env.sh (if the backup does not
14
- # already exist) to make it easier for a user to downgrade
15
- env_backup = File.join(root_dir, 'env.sh-autoproj-v1')
16
- if !File.file?(env_backup)
17
- FileUtils.cp File.join(root_dir, 'env.sh'), env_backup
18
- end
19
-
20
- # Do an install
21
- installer.run
22
-
23
- # Copy the current configuration, merging it with the autoproj
24
- # 2.x attributes
25
- current_config = File.open(File.join(root_dir, 'autoproj', 'config.yml')) do |io|
26
- YAML.load(io)
27
- end
28
- config_file_path = File.join(root_dir, '.autoproj', 'config.yml')
29
- new_config = File.open(config_file_path) do |io|
30
- YAML.load(io)
31
- end
32
- File.open(config_file_path, 'w') do |io|
33
- io.write YAML.dump(current_config.merge(new_config))
34
- end
35
-
36
- # Copy the remotes symlinks
37
- FileUtils.cp_r File.join(root_dir, '.remotes'), File.join(root_dir, '.autoproj', 'remotes')
38
- # Copy the installation manifest
39
- FileUtils.cp File.join(root_dir, '.autoproj-installation-manifest'),
40
- File.join(root_dir, '.autoproj', 'installation-manifest')
41
-
42
- puts "now, open a new console, source env.sh and run"
43
- puts " autoproj osdeps"
44
- puts " autoproj envsh"
45
- end
46
-
47
- def create_installer(root_dir, options = Hash.new)
48
- installer = Autoproj::Ops::Install.new(root_dir)
49
- installer.local = options[:local]
50
- installer.private_bundler = options[:private_bundler] || options[:private]
51
- installer.private_autoproj = options[:private_autoproj] || options[:private]
52
- installer.private_gems = options[:private_gems] || options[:private]
53
- if gemfile_path = options[:gemfile]
54
- installer.gemfile = File.read(gemfile_path)
55
- end
56
- installer
57
- end
58
-
59
- def run(options = Hash.new)
60
- root_dir = Autoproj.find_v2_workspace_dir
61
- if root_dir && File.directory?(File.join(root_dir, '.autoproj'))
62
- installer = create_installer(root_dir, options)
63
- return upgrade_from_v2(installer, options)
64
- end
65
-
66
- root_dir = Autoproj.find_v1_workspace_dir
67
- if root_dir && File.directory?(File.join(root_dir, '.gems'))
68
- installer = create_installer(root_dir, options)
69
- return upgrade_from_v1(installer, options)
70
- end
71
- end
72
- end
73
- end
74
- end
75
-