syncwrap 2.9.0 → 2.9.1

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: ae35d27dcde1232833010cd8c54f0ee90cebc534
4
- data.tar.gz: 82ab6099f4a345f2f0e44636015450d2ba0a3521
3
+ metadata.gz: 41675f753b936a41dfa9adc50306cba476cb7809
4
+ data.tar.gz: 8a61feac7054cf90aa1226abe47fbaf5b1e88913
5
5
  SHA512:
6
- metadata.gz: 6a2b7367f7d7cde4bad82143a1e0979e240f80cf9d8ae72e13f180da9cda6005e5c8eec13f56c15713cea70c43ade473252d0f870009aef7011c278e290ff403
7
- data.tar.gz: 12feeb0d898f1349077b74272db9f106679ba2fc765a8e04705bf31b42a49b03bb6d114aaa59d2cd5292790a50c9cc72c884f1e6646e90436dcc671575834f30
6
+ metadata.gz: 357c6f3382234c6bf91e49e43434a0056ead68bd30921276101b0e2399011de55d202b9f90fa9a48e016a12e8b34e20445df6dd06ce99121d9b75a5054bf9aca
7
+ data.tar.gz: 85a464dd1ebe06e37de0973cb90a00bf660eea82807d7cc34ac3da29bbfa93c01ba55a349fe13047d60a71671ccb495b5920fde86d5c0f3221e166e696d73468
data/History.rdoc CHANGED
@@ -1,3 +1,16 @@
1
+ === 2.9.1 (2017-8-4)
2
+ * SyncWrap::JRubyVM
3
+ * Avoid setting Env['GEM_HOME'] in the jruby 9.x installed profile
4
+ by default. In 2.9.0, this was added as a substitute for the
5
+ jruby.gem.home system property, which when set caused incessant
6
+ warnings with 9.x. However setting GEM_HOME also undesirably
7
+ effects gem bin wrapper install location. Instead just use the
8
+ default in-dist path of jruby 9.x, and system gems will need to be
9
+ re-installed with a jruby upgrade.
10
+ * Add support for fast path gem user_install (no-op if same version
11
+ specification is found)
12
+ * Fix error message for CLI -S (session) with host not found
13
+
1
14
  === 2.9.0 (2017-7-18)
2
15
  * SyncWrap::Debian
3
16
  * Fix Debian#dist_if_installed? grep pattern. Was previously giving
@@ -20,7 +33,7 @@
20
33
  * Add --yes flag to final lvconvert call, required by later
21
34
  versions, compatible with earlier
22
35
  * Add thin-provisioning-tools as dependency on Debian, as the included
23
- cached_check command is needed for reboot.
36
+ cache_check command is needed for reboot.
24
37
  * SyncWrap::Sudoers
25
38
  * Collect all sudoers config details here. This was previously
26
39
  spread between SyncWrap::Users and SyncWrap::UserData.
data/lib/syncwrap/base.rb CHANGED
@@ -15,7 +15,7 @@
15
15
  #++
16
16
 
17
17
  module SyncWrap
18
- VERSION='2.9.0'
18
+ VERSION='2.9.1'
19
19
 
20
20
  GEM_ROOT = File.dirname(File.dirname(File.dirname(__FILE__))) # :nodoc:
21
21
  end
data/lib/syncwrap/cli.rb CHANGED
@@ -268,7 +268,7 @@ TEXT
268
268
 
269
269
  if @ssh_session
270
270
  host = space.get_host( @ssh_session )
271
- host = space.ssh_host_name( host )
271
+ host &&= space.ssh_host_name( host )
272
272
  raise "Host #{@ssh_session} not found in sync file" unless host
273
273
  extra_args = @component_plan
274
274
  raise "SSH args? #{extra_args.inspect}" if extra_args.first =~ /^[^\-]/
@@ -77,8 +77,43 @@ module SyncWrap
77
77
  "#{jruby_dist_path}/etc"
78
78
  end
79
79
 
80
+ # The jruby system gem home, depending on #jruby_gem_home_prop?
80
81
  def jruby_gem_home
81
- "#{local_root}/lib/jruby/gems"
82
+ if jruby_gem_home_prop?
83
+ "#{local_root}/lib/jruby/gems"
84
+ else
85
+ "#{jruby_dist_path}/lib/ruby/gems/shared"
86
+ end
87
+ end
88
+
89
+ def jruby_user_gem_dir( user )
90
+ "~#{user}/.gem/jruby/#{ruby_compat_version}"
91
+ end
92
+
93
+ # True if jruby (1.7.x) supports an alternative system gem home
94
+ # via the jruby.gem.home java property. By default, for jruby
95
+ # 1.7.x this will be used to move gems outside to allow for
96
+ # graceful jruby upgrades without needing to reinstall gems.
97
+ #
98
+ # Jruby 9.x continues to abide by this property, through 9.1.12.0
99
+ # atleast, but with an incessant warning, so the setting is
100
+ # dropped by default.
101
+ attr_writer :jruby_gem_home_prop
102
+
103
+ def jruby_gem_home_prop?
104
+ @jruby_gem_home_prop ||= version_lt?( jruby_version, [9] )
105
+ end
106
+
107
+ # The ruby compatability version, as can be found in
108
+ # RbConfig::CONFIG['ruby_version'] on the same ruby, and used as a
109
+ # sub-directory of the user gem directory. In recent rubies this is 3
110
+ # version numbers with 0 in the least significant (ruby naming:
111
+ # TEENY) position, e.g. '2.3.0'. By default, computed based on
112
+ # jruby_version for known versions.
113
+ attr_writer :ruby_compat_version
114
+
115
+ def ruby_compat_version
116
+ @ruby_compat_version ||= default_ruby_compat_version
82
117
  end
83
118
 
84
119
  # Install jruby if the jruby_version is not already present.
@@ -132,29 +167,39 @@ module SyncWrap
132
167
  version = Array( opts[ :version ] )
133
168
  ver = (version.length == 1) && version[0] =~ /^=?\s*([0-9]\S+)/ && $1
134
169
 
135
- unless ( opts[:check] || opts[:user_install] ||
136
- opts[:minimize] == false || opts[:spec_check] == false ||
170
+ unless ( opts[:check] ||
171
+ opts[:minimize] == false ||
172
+ opts[:spec_check] == false ||
137
173
  ver.nil? )
138
174
 
139
- specs = [ "#{jruby_gem_home}/specifications/#{gem}-#{ver}-java.gemspec",
140
- "#{jruby_gem_home}/specifications/#{gem}-#{ver}.gemspec" ]
175
+ prefix = if opts[:user_install]
176
+ jruby_user_gem_dir( opts[:user_install] )
177
+ else
178
+ jruby_gem_home
179
+ end
180
+
181
+ specs = [ "#{prefix}/specifications/#{gem}-#{ver}-java.gemspec",
182
+ "#{prefix}/specifications/#{gem}-#{ver}.gemspec" ]
183
+
184
+ cond = "if [ ! -e #{specs[0]} -a ! -e #{specs[1]} ]; then"
185
+ shopts = { close: 'fi' }
186
+ case opts[ :user_install ]
187
+ when String
188
+ shopts[ :user ] = opts[ :user_install ]
189
+ when nil, false
190
+ shopts[ :user ] = :root
191
+ end
141
192
 
142
- sudo( "if [ ! -e '#{specs[0]}' -a ! -e '#{specs[1]}' ]; then",
143
- close: "fi" ) do
193
+ sh( cond, shopts ) do
144
194
  super
145
195
  end
146
196
  else
147
197
  super
148
198
  end
149
-
150
199
  end
151
200
 
152
201
  alias :jruby_gem_install :gem_install
153
202
 
154
- def jruby_gem_home_prop?
155
- version_lt?( jruby_version, [9] )
156
- end
157
-
158
203
  protected
159
204
 
160
205
  def min_deps_supported?
@@ -165,6 +210,16 @@ module SyncWrap
165
210
  Array( reqs ).flatten.compact.map { |req| "-v'#{req}'" }
166
211
  end
167
212
 
213
+ def default_ruby_compat_version
214
+ if version_lt?( jruby_version, [9] )
215
+ '1.9'
216
+ elsif version_lt?( jruby_version, [9,1] )
217
+ '2.2.0'
218
+ else
219
+ '2.3.0'
220
+ end
221
+ end
222
+
168
223
  end
169
224
 
170
225
  end
@@ -1,4 +1,4 @@
1
- # HashDot launch profile for JRuby (http://jruby.codehaus.org/)
1
+ # HashDot launch profile for JRuby
2
2
  #. hashdot.profile = jruby
3
3
 
4
4
  jruby.home = <%= jruby_dist_path %>
@@ -8,10 +8,8 @@ jruby.shell = /bin/sh
8
8
  jruby.bindir = <%= local_root %>/bin
9
9
 
10
10
  hashdot.profile += jruby-common
11
-
12
- # Rubygems Home (Install)
13
11
  <% if jruby_gem_home_prop? %>
14
- jruby.gem.home = <%= local_root %>/lib/jruby/gems
15
- <% else %>
16
- hashdot.env.GEM_HOME = <%= local_root %>/lib/jruby/gems
12
+
13
+ # System Rubygems Home
14
+ jruby.gem.home = <%= jruby_gem_home %>
17
15
  <% end %>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: syncwrap
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.9.0
4
+ version: 2.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Kellum
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-18 00:00:00.000000000 Z
11
+ date: 2017-08-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: term-ansicolor