origen 0.8.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7ed980dcd18e1d53defcd27928d2fae2b5c6fe53
4
- data.tar.gz: c9d7b163c3c5d219ea8b81f0b624938cf5049877
3
+ metadata.gz: f06ba92ddb653da06e04e5d11ae538df9160a524
4
+ data.tar.gz: 6330aedcfda4aaaea9bc0896cc614d9c6c81ccb8
5
5
  SHA512:
6
- metadata.gz: 540490e6a49ea8c7acef2f18d56eec937a14fe826b91f48fc0344a52ee9027d6310ed9546a77f1d2a95a484123feac4ca366228b8b8c01bfa79ed1f575f7ac5a
7
- data.tar.gz: 83801037183ae53aa780c1c06c4a15bc9976361e2a552011195176eb8004353a69a1b58b525de23ec4373906dc6ad7b8c4b395aec07a65c300e469fc7728ae22
6
+ metadata.gz: 882c0a347492a5732f9ffd899d37cd695caee042a2c591839557974eb89057f4e351d249eb8823f5e937cb569c0d33b6171a686251f1bd09088b9662085f0ced
7
+ data.tar.gz: c685c4ad3c3bc97747cd2d74b80a3f2026a1d40e4ba058f942dd113fd19bf681c01980c31441a0451ef09e1ce4d0eaef5d4b4f7d472316498f6e876a550a02cc
@@ -0,0 +1,60 @@
1
+ #!/usr/bin/env ruby
2
+ $VERBOSE = nil # Don't care about world writable dir warnings and the like
3
+ #require 'byebug' # Un-comment to debug this file
4
+ require 'fileutils'
5
+ require 'pathname'
6
+
7
+ local_gem_dir = ARGV.shift
8
+
9
+ unless ARGV.empty?
10
+ %w(bin cache extensions gems specifications).each do |subdir|
11
+ d = "#{local_gem_dir}/#{subdir}"
12
+ FileUtils.mkdir_p(d) unless File.exist?(d)
13
+ end
14
+ end
15
+
16
+ ARGV.each_slice(2) do |gem, version|
17
+ begin
18
+ spec = Gem::Specification.find_by_name(gem, version)
19
+ begin
20
+ (spec.executables || []).each do |bin|
21
+ unless File.exist?("#{local_gem_dir}/bin/#{bin}")
22
+ FileUtils.cp("#{spec.bin_dir}/#{bin}", "#{local_gem_dir}/bin")
23
+ end
24
+ end
25
+ p = Pathname.new(spec.cache_file)
26
+ unless File.exist?("#{local_gem_dir}/cache/#{p.basename}")
27
+ FileUtils.cp(spec.cache_file, "#{local_gem_dir}/cache")
28
+ end
29
+ if spec.extension_dir && File.exist?(spec.extension_dir)
30
+ spec.extension_dir =~ /.*extensions(.*)/
31
+ sub_dir = Pathname.new(Regexp.last_match(1)).dirname.to_s
32
+ local_ext_dir = "#{local_gem_dir}/extensions/#{sub_dir}"
33
+ FileUtils.mkdir_p(local_ext_dir) unless File.exist?(local_ext_dir)
34
+
35
+ # If the file exists in the extensions directory, skip copying it over.
36
+ p = Pathname.new(spec.extension_dir)
37
+ unless File.exist?("#{local_ext_dir}/#{p.basename}")
38
+ FileUtils.cp_r(spec.extension_dir, local_ext_dir)
39
+ end
40
+ end
41
+
42
+ # If the file exists in the gem directory, skip copying it over.
43
+ p = Pathname.new(spec.gem_dir)
44
+ unless File.exist?("#{local_gem_dir}/gems/#{p.basename}")
45
+ FileUtils.cp_r(spec.gem_dir, "#{local_gem_dir}/gems")
46
+ end
47
+ # If the file exists in the specifications directory, skip copying it over.
48
+ p = Pathname.new(spec.spec_file)
49
+ unless File.exist?("#{local_gem_dir}/specifications/#{p.basename}")
50
+ FileUtils.cp(spec.spec_file, "#{local_gem_dir}/specifications")
51
+ end
52
+ rescue
53
+ puts "Had problems installing #{spec.name} from your system Ruby, proceeding with fingers crossed..."
54
+ end
55
+
56
+ rescue Gem::LoadError
57
+ # This just means that one of the gems that should be copied from the system
58
+ # was not actually installed in the system, so nothing we can do about that here
59
+ end
60
+ end
data/bin/origen CHANGED
@@ -3,6 +3,7 @@ $VERBOSE = nil # Don't care about world writable dir warnings and the like
3
3
 
4
4
  require 'pathname'
5
5
  require 'fileutils'
6
+ #require 'byebug' # Un-comment to debug this file
6
7
 
7
8
  class OrigenBootError < StandardError
8
9
  end
@@ -45,33 +46,36 @@ else
45
46
  end
46
47
 
47
48
  if origen_root
49
+ # Force everyone to have a consistent way of installing gems with bundler
50
+ ENV['BUNDLE_GEMFILE'] = File.join(origen_root, 'Gemfile')
51
+ ENV['BUNDLE_PATH'] = File.expand_path(Origen.site_config.gem_install_dir)
52
+ ENV['BUNDLE_BIN'] = File.join(origen_root, 'lbin')
53
+
54
+ # Ensure that system gems are copied to the local gem dir every time, this might waste a little bit
55
+ # of time, but it ensures that any updates to the system gem list are automatically applied which
56
+ # is helpful in a corporate environment with no sudo access to the Ruby installation
57
+ #
58
+ # This is invoked from an external process so that it can step out of this bundled environment
59
+ # and have visibility of the system gems
60
+ if Origen.site_config.gem_manage_bundler && Origen.site_config.gem_use_from_system
61
+ exe = File.expand_path('../copy_system_gems', __FILE__)
62
+ gems = Origen.site_config.gem_use_from_system.map { |g,v| "#{g} #{v}" }.join(' ')
63
+ local_gem_dir = "#{ENV['BUNDLE_PATH']}/ruby/#{Pathname.new(Gem.dir).basename}"
64
+ Bundler.with_clean_env do
65
+ system "#{exe} #{local_gem_dir} #{gems}"
66
+ end
67
+ end
68
+
48
69
  # If it looks like a bundled binstub of origen exists, and we have not been invoked through that,
49
70
  # then run that instead.
50
71
  if Origen.site_config.gem_manage_bundler && File.exist?("#{origen_root}/lbin/origen") && !ENV['BUNDLE_BIN_PATH'] &&
51
72
  File.exist?(File.expand_path(Origen.site_config.gem_install_dir))
52
73
  exec Gem.ruby, "#{origen_root}/lbin/origen", *ARGV
53
74
  exit 0
54
- else
55
- # Force everyone to have a consistent way of installing gems with bundler
56
- ENV['BUNDLE_GEMFILE'] = File.join(origen_root, 'Gemfile')
57
- ENV['BUNDLE_PATH'] = File.expand_path(Origen.site_config.gem_install_dir)
58
- ENV['BUNDLE_BIN'] = File.join(origen_root, 'lbin')
59
75
  end
60
76
  end
61
77
 
62
78
  if origen_root && File.exist?(ENV['BUNDLE_GEMFILE']) && Origen.site_config.gem_manage_bundler
63
- # Retrieve any system gem specs that might be required before we enter the clean env
64
- if Origen.site_config.gem_manage_bundler && Origen.site_config.gem_use_from_system
65
- system_gem_specs = Origen.site_config.gem_use_from_system.map do |gem, version|
66
- begin
67
- Gem::Specification.find_by_name(gem, version)
68
- rescue Gem::LoadError
69
- end
70
- end
71
- else
72
- system_gem_specs = []
73
- end
74
-
75
79
  # Overriding bundler here so that bundle install can be automated as required
76
80
  require 'bundler/shared_helpers'
77
81
  if Bundler::SharedHelpers.in_bundle?
@@ -91,9 +95,6 @@ if origen_root && File.exist?(ENV['BUNDLE_GEMFILE']) && Origen.site_config.gem_m
91
95
  `chmod o-w #{origen_root}/.bin` if File.exist?("#{origen_root}/.bin")
92
96
  result = false
93
97
 
94
- # Set this here since the clean environment will not have access to the ENV variable
95
- local_gem_dir = "#{ENV['BUNDLE_PATH']}/ruby/#{Pathname.new(Gem.dir).basename}"
96
-
97
98
  Bundler.with_clean_env do
98
99
  if Origen.os.unix?
99
100
  if Origen.site_config.gem_build_switches
@@ -121,55 +122,6 @@ if origen_root && File.exist?(ENV['BUNDLE_GEMFILE']) && Origen.site_config.gem_m
121
122
  else
122
123
  puts 'Unable to determine gcc version, proceeding with fingers crossed...'
123
124
  end
124
- # Need to compact the system gem specs array to remove reference to any nil elements which will cause an error below.
125
- system_gem_specs.compact!
126
- # Some gems (particularly those with C extensions that need to be built), can be hard to install reliably
127
- # across a large user base. Initially seed the user's local gem area with the system-installed gems,
128
- # this means that the system Ruby owner can provide an installation for these hard-to-install gems.
129
- unless system_gem_specs.empty?
130
- %w(bin cache extensions gems specifications).each do |subdir|
131
- d = "#{local_gem_dir}/#{subdir}"
132
- FileUtils.mkdir_p(d) unless File.exist?(d)
133
- end
134
- system_gem_specs.each do |spec|
135
- begin
136
- (spec.executables || []).each do |bin|
137
- unless File.exist?("#{local_gem_dir}/bin/#{bin}")
138
- FileUtils.cp("#{spec.bin_dir}/#{bin}", "#{local_gem_dir}/bin")
139
- end
140
- end
141
- p = Pathname.new(spec.cache_file)
142
- unless File.exist?("#{local_gem_dir}/cache/#{p.basename}")
143
- FileUtils.cp(spec.cache_file, "#{local_gem_dir}/cache")
144
- end
145
- if spec.extension_dir && File.exist?(spec.extension_dir)
146
- spec.extension_dir =~ /.*extensions(.*)/
147
- sub_dir = Pathname.new(Regexp.last_match(1)).dirname.to_s
148
- local_ext_dir = "#{local_gem_dir}/extensions/#{sub_dir}"
149
- FileUtils.mkdir_p(local_ext_dir) unless File.exist?(local_ext_dir)
150
-
151
- # If the file exists in the extensions directory, skip copying it over.
152
- p = Pathname.new(spec.extension_dir)
153
- unless File.exist?("#{local_ext_dir}/#{p.basename}")
154
- FileUtils.cp_r(spec.extension_dir, local_ext_dir)
155
- end
156
- end
157
-
158
- # If the file exists in the gem directory, skip copying it over.
159
- p = Pathname.new(spec.gem_dir)
160
- unless File.exist?("#{local_gem_dir}/gems/#{p.basename}")
161
- FileUtils.cp_r(spec.gem_dir, "#{local_gem_dir}/gems")
162
- end
163
- # If the file exists in the specifications directory, skip copying it over.
164
- p = Pathname.new(spec.spec_file)
165
- unless File.exist?("#{local_gem_dir}/specifications/#{p.basename}")
166
- FileUtils.cp(spec.spec_file, "#{local_gem_dir}/specifications")
167
- end
168
- rescue
169
- puts "Had problems installing #{spec.name} from your system Ruby, proceeding with fingers crossed..."
170
- end
171
- end
172
- end
173
125
  end
174
126
  result = system(cmd)
175
127
  end
data/config/version.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  module Origen
2
2
  MAJOR = 0
3
- MINOR = 8
3
+ MINOR = 9
4
4
  BUGFIX = 0
5
5
  DEV = nil
6
6
 
@@ -49,6 +49,8 @@ module Origen
49
49
  # Add any site_configs from where we are currently running from, i.e. the application
50
50
  # directory area
51
51
  until path.root?
52
+ file = File.join(path, 'config', 'origen_site_config.yml')
53
+ configs << YAML.load_file(file) if File.exist?(file)
52
54
  file = File.join(path, 'origen_site_config.yml')
53
55
  configs << YAML.load_file(file) if File.exist?(file)
54
56
  path = path.parent
@@ -13,8 +13,9 @@ gem_install_dir: ~/.origen/gems
13
13
  # it fresh for each user.
14
14
  # Note that this option will only be applied if gem_manage_bundler is set to true.
15
15
  gem_use_from_system:
16
- - [nokogiri, 1.6.4.1] # Only required for early versions of Origen
17
- - [nokogiri, 1.6.7.2]
16
+ - [nokogiri, 1.6.4.1] # Only required for earlier versions of Origen
17
+ - [nokogiri, 1.6.7.2] # Only required for earlier versions of Origen
18
+ - [nokogiri, 1.7.2]
18
19
  # Additionally any build switches/options that are required to build specific gems
19
20
  # in your user environment can be defined here.
20
21
  #gem_build_switches:
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: origen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen McGinty
@@ -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,6 +346,7 @@ executables:
346
346
  extensions: []
347
347
  extra_rdoc_files: []
348
348
  files:
349
+ - bin/copy_system_gems
349
350
  - bin/origen
350
351
  - config/application.rb
351
352
  - config/boot.rb
@@ -582,7 +583,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
582
583
  version: 1.8.11
583
584
  requirements: []
584
585
  rubyforge_project:
585
- rubygems_version: 2.5.2
586
+ rubygems_version: 2.6.7
586
587
  signing_key:
587
588
  specification_version: 4
588
589
  summary: The Semiconductor Developer's Kit