origen 0.10.1 → 0.11.0

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: a74d6c5e91701aa0a8f1c90b52ae3fc3414b6403
4
- data.tar.gz: 5736a47e4479517d364734301c98aa36f099a6a7
3
+ metadata.gz: 2b03ec3627ba26fc085e2a5302472d6bf13522bb
4
+ data.tar.gz: e915a39f3b40a64aa4255b13293570b37abdd765
5
5
  SHA512:
6
- metadata.gz: e5b2083ade87f88644af98ec619de196fd688b49d162c54f89a3af19a71cddcef7a86860e240fd4b07b4ac8c14432991eba7b6b4ed6c845e3760e9552c81bc9f
7
- data.tar.gz: dc4cf50f16fab69fe59d6108fb90ed7e5fb840a74d26230f102828820e3c3e83398540f019542368b0b0b32ee68a2c9d896fdee993996bbc89aae0ae1b39f3c2
6
+ metadata.gz: 958952409ba581f177774cc2dbe23eb42cc018fdf64eca2faa1708f7356c73beebc886678c4cb0fb6e8d7fac726f1fc20979cd7e233ced7d848a7724a8fd92bb
7
+ data.tar.gz: 5ad6fb24cdf7c84f05bf7cc854c917e63e86c29eb133eee45f6e5ced7ac870ca108be1a0dcc4456af8f0d7f9696cecfe9103a4a76632ffc88eaf7a2a73360cab
@@ -0,0 +1,78 @@
1
+ #!/usr/bin/env ruby
2
+ $VERBOSE = nil # Don't care about world writable dir warnings and the like
3
+
4
+ if $_fix_my_workspace_version_check
5
+ $_fix_my_workspace_version = '0.5.0'
6
+ else
7
+ require 'origen'
8
+
9
+ if !Origen.site_config.gem_manage_bundler
10
+ puts 'Sorry but you have opted to manage Bundler yourself via your Origen site config, and this means'
11
+ puts 'that I cannot make certain assumptions about how your workspace is configured.'
12
+ puts 'You will need to either resolve this problem yourself, or else change the value of'
13
+ puts 'gem_mange_bundler to true.'
14
+ puts 'See here for more details on how to do that: http://origen-sdk.org/origen/guides/starting/company/'
15
+
16
+ else
17
+ ENV['BUNDLE_GEMFILE'] = File.join(Origen.root, 'Gemfile')
18
+ ENV['BUNDLE_PATH'] = File.expand_path(Origen.site_config.gem_install_dir)
19
+ ENV['BUNDLE_BIN'] = File.join(Origen.root, 'lbin')
20
+
21
+ # Force copy system gems to local gems
22
+ if Origen.site_config.gem_use_from_system
23
+ local_gem_dir = "#{ENV['BUNDLE_PATH']}/ruby/#{Pathname.new(Gem.dir).basename}"
24
+ gem_dir = Pathname.new(Gem.dir)
25
+
26
+ Origen.site_config.gem_use_from_system.each do |gem, version|
27
+ begin
28
+ # This will raise an error if the system doesn't have this gem installed, that
29
+ # will be rescued below
30
+ spec = Gem::Specification.find_by_name(gem, version)
31
+
32
+ local_dir = File.join(local_gem_dir, Pathname.new(spec.gem_dir).relative_path_from(gem_dir))
33
+ FileUtils.mkdir_p local_dir
34
+ FileUtils.cp_r("#{spec.gem_dir}/.", local_dir)
35
+
36
+ local_file = Pathname.new(File.join(local_gem_dir, Pathname.new(spec.cache_file).relative_path_from(gem_dir)))
37
+ FileUtils.mkdir_p local_file.dirname
38
+ FileUtils.cp(spec.cache_file, local_file)
39
+
40
+ if spec.extension_dir && File.exist?(spec.extension_dir)
41
+ local_dir = File.join(local_gem_dir, Pathname.new(spec.extension_dir).relative_path_from(gem_dir))
42
+ FileUtils.mkdir_p local_dir
43
+ FileUtils.cp_r("#{spec.extension_dir}/.", local_dir)
44
+ end
45
+
46
+ local_file = Pathname.new(File.join(local_gem_dir, Pathname.new(spec.spec_file).relative_path_from(gem_dir)))
47
+ FileUtils.mkdir_p local_file.dirname
48
+ FileUtils.cp(spec.spec_file, local_file)
49
+
50
+ rescue Gem::LoadError
51
+ # This just means that one of the gems that should be copied from the system
52
+ # was not actually installed in the system, so nothing we can do about that here
53
+ end
54
+ end
55
+ end
56
+
57
+ # Delete lbin
58
+ FileUtils.rm_rf(ENV['BUNDLE_BIN']) if File.exist?(ENV['BUNDLE_BIN'])
59
+
60
+ # Run bundler with correct switches
61
+ cmd = "bundle install --gemfile #{ENV['BUNDLE_GEMFILE']} --binstubs #{ENV['BUNDLE_BIN']} --path #{ENV['BUNDLE_PATH']}"
62
+ `chmod o-w #{Origen.root}` # Stops some annoying world writable warnings during install
63
+ `chmod o-w #{Origen.root}/bin` if File.exist?("#{Origen.root}/bin")
64
+ `chmod o-w #{Origen.root}/.bin` if File.exist?("#{Origen.root}/.bin")
65
+
66
+ # Try again, this time updating the bundle
67
+ if system(cmd)
68
+ fixed = true
69
+ elsif system 'bundle update'
70
+ fixed = true
71
+ end
72
+
73
+ `chmod o-w #{ENV['BUNDLE_BIN']}` if File.exist?(ENV['BUNDLE_BIN'])
74
+
75
+ system 'origen -v' if fixed
76
+
77
+ end
78
+ end
data/bin/origen CHANGED
@@ -51,34 +51,6 @@ if origen_root
51
51
  ENV['BUNDLE_PATH'] = File.expand_path(Origen.site_config.gem_install_dir)
52
52
  ENV['BUNDLE_BIN'] = File.join(origen_root, 'lbin')
53
53
 
54
- if ARGV.first == 'update'
55
- ARGV.shift
56
- local_gem_dir = "#{ENV['BUNDLE_PATH']}/ruby/#{Pathname.new(Gem.dir).basename}"
57
- updater_dir = Dir.glob("#{local_gem_dir}/gems/origen_updater-*").sort.last
58
- exe = File.expand_path('../update', __FILE__)
59
- require 'bundler'
60
-
61
- args = ARGV.join(' ')
62
-
63
- on_updated_callback = lambda do
64
- Bundler.with_clean_env do
65
- system "#{exe} #{origen_root} #{updater_dir}/lib/origen_updater/on_updated #{args}"
66
- end
67
- end
68
-
69
- # This is invoked from an external process so that it can step out of this bundled environment
70
- # and have visibility of the system gems
71
- Bundler.with_clean_env do
72
- system "#{exe} #{origen_root} #{updater_dir}/lib/origen_updater/update #{args}"
73
- end
74
-
75
- # Now fall through and act like 'origen -v'
76
- while ARGV.size > 0 do
77
- ARGV.pop
78
- end
79
- ARGV << '-v'
80
- end
81
-
82
54
  # If it looks like a bundled binstub of origen exists, and we have not been invoked through that,
83
55
  # then run that instead.
84
56
  if Origen.site_config.gem_manage_bundler && File.exist?("#{origen_root}/lbin/origen") && !ENV['BUNDLE_BIN_PATH'] &&
@@ -157,7 +129,6 @@ if origen_root && File.exist?(ENV['BUNDLE_GEMFILE']) && Origen.site_config.gem_m
157
129
  end
158
130
  end
159
131
  if result
160
- on_updated_callback.call if on_updated_callback
161
132
  exec "origen #{ARGV.join(' ')}"
162
133
  exit 0
163
134
  else
@@ -171,7 +142,6 @@ if origen_root && File.exist?(ENV['BUNDLE_GEMFILE']) && Origen.site_config.gem_m
171
142
  Bundler.setup
172
143
  end
173
144
  end
174
- on_updated_callback.call if on_updated_callback
175
145
  require 'bundler/setup'
176
146
  require 'origen'
177
147
  else
data/config/version.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  module Origen
2
2
  MAJOR = 0
3
- MINOR = 10
4
- BUGFIX = 1
3
+ MINOR = 11
4
+ BUGFIX = 0
5
5
  DEV = nil
6
6
 
7
7
  VERSION = [MAJOR, MINOR, BUGFIX].join(".") + (DEV ? ".pre#{DEV}" : '')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: origen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.1
4
+ version: 0.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen McGinty
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-23 00:00:00.000000000 Z
11
+ date: 2017-05-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -86,14 +86,14 @@ dependencies:
86
86
  requirements:
87
87
  - - '='
88
88
  - !ruby/object:Gem::Version
89
- version: 1.6.7.2
89
+ version: 1.7.2
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - '='
95
95
  - !ruby/object:Gem::Version
96
- version: 1.6.7.2
96
+ version: 1.7.2
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: rspec
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -346,8 +346,8 @@ executables:
346
346
  extensions: []
347
347
  extra_rdoc_files: []
348
348
  files:
349
+ - bin/fix_my_workspace
349
350
  - bin/origen
350
- - bin/update
351
351
  - config/application.rb
352
352
  - config/boot.rb
353
353
  - config/commands.rb
data/bin/update DELETED
@@ -1,23 +0,0 @@
1
- #!/usr/bin/env ruby
2
- $VERBOSE = nil # Don't care about world writable dir warnings and the like
3
-
4
- require 'pathname'
5
- #require 'byebug' # Un-comment to debug this file
6
-
7
- # Keep a note of the pwd at the time when Origen was first loaded, this is initially used
8
- # by the site_config lookup.
9
- $_origen_invocation_pwd ||= Pathname.pwd
10
-
11
- load File.expand_path('../../lib/origen/operating_systems.rb', __FILE__)
12
- load File.expand_path('../../lib/origen/site_config.rb', __FILE__)
13
-
14
- origen_root = ARGV.shift
15
-
16
- # Force everyone to have a consistent way of installing gems with bundler
17
- ENV['BUNDLE_GEMFILE'] = File.join(origen_root, 'Gemfile')
18
- ENV['BUNDLE_PATH'] = File.expand_path(Origen.site_config.gem_install_dir)
19
- ENV['BUNDLE_BIN'] = File.join(origen_root, 'lbin')
20
-
21
- require ARGV.shift
22
-
23
-