rbbt-util 5.26.20 → 5.26.21

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
  SHA256:
3
- metadata.gz: b92efe3e401eaeeec427031f665e88ece42c4a8a39cac35ff1c2ed5148f471fe
4
- data.tar.gz: 77269b375e40fcce3b5ba4589c6422a6253a8a0cc136689c964d7323734e8755
3
+ metadata.gz: a0ffa5b32ce869fb1371baa14d9d66cd30d37f829b8bc3dd55807afeddf188ee
4
+ data.tar.gz: 95c3cd549d8719e6f3da4eb89d64fd9915666c84d76eebc123067f9272d4036b
5
5
  SHA512:
6
- metadata.gz: fcd84776db4a825762d260cc34575d74f8943543c2d410fb38a488c67e9f92210d59ada1f1b1c5dc94f40ec1a7e41bc796d1634fa27108811e132586ba1173e9
7
- data.tar.gz: 532000c51cae567f919da52d4daed6941264d09bf05040b0bce6f3a3a7e490deeacbdefa4e48172308781f7b2489595480c13e08a9ae3a45e2ce9e99ec0803cf
6
+ metadata.gz: db46d5759962c088304b67cdf3f7b76282caaa343e4b1a14a32bae6c0c51277f7fedc25713792a07e6898252a2f05f62baf3cd6b08092ab14a6453834ecf08b9
7
+ data.tar.gz: 21d0111d50df3e10d29f563ec657f22df9e0e9623cd00733f8f98749434f38b048ae65ca8f017db5eb770a44cb1c8a2d18ee624fd5cd3048b70a6baf2b4ec55b
data/lib/rbbt/resource.rb CHANGED
@@ -205,7 +205,65 @@ INSTALL_HELPER_FILE="#{helper_file}"
205
205
  source "$INSTALL_HELPER_FILE"
206
206
  EOF
207
207
 
208
- script = preamble + "\n" + Open.read(content)
208
+ content = content.call if Proc === content
209
+
210
+ content = if content =~ /git:|\.git$/
211
+ {:git => content}
212
+ else
213
+ {:src => content}
214
+ end if String === content and Open.remote?(content)
215
+
216
+ script_text = case content
217
+ when nil
218
+ raise "No way to install #{path}"
219
+ when Path
220
+ Open.read(content)
221
+ when String
222
+ if Misc.is_filename?(content) and Open.exists?(content)
223
+ Open.read(content)
224
+ else
225
+ content
226
+ end
227
+ when Hash
228
+ name = content[:name] || File.basename(path)
229
+ git = content[:git]
230
+ src = content[:src]
231
+ url = content[:url]
232
+ extra = content[:extra]
233
+ commands = content[:commands]
234
+ if git
235
+ <<-EOF
236
+
237
+ name='#{name}'
238
+ url='#{git}'
239
+
240
+ install_git "$name" "$url" #{extra}
241
+
242
+ #{commands}
243
+ EOF
244
+ elsif src
245
+ <<-EOF
246
+
247
+ name='#{name}'
248
+ url='#{src}'
249
+
250
+ install_src "$name" "$url" #{extra}
251
+
252
+ #{commands}
253
+ EOF
254
+ else
255
+ <<-EOF
256
+
257
+ name='#{name}'
258
+ url='#{url}'
259
+
260
+ #{commands}
261
+ EOF
262
+ end
263
+ end
264
+
265
+ script = preamble + "\n" + script_text
266
+ Log.debug "Installing software with script:\n" << script
209
267
  CMD.cmd_log('bash', :in => script)
210
268
 
211
269
  set_software_env(software_dir) unless $set_software_env
@@ -99,14 +99,14 @@ end
99
99
  res
100
100
  end
101
101
 
102
- def self.filename?(string)
103
- String === string and string.length > 0 and string.length < 250 and File.exist?(string)
104
- end
105
-
106
102
  def self.is_filename?(string)
107
103
  return true if defined? PATH and Path === string
108
104
  return true if string.respond_to? :exists
109
- return true if String === string and string.length < 265 and File.exist? string
105
+ return true if String === string and string.length < 265 and File.exist?(string)
110
106
  return false
111
107
  end
108
+
109
+ class << self
110
+ alias filename? is_filename?
111
+ end
112
112
  end
@@ -273,8 +273,6 @@ build_make(){
273
273
  setup "$name"
274
274
  clean_build
275
275
  fi
276
-
277
- cd "$old_pwd"
278
276
  }
279
277
 
280
278
  buid_cmake(){
@@ -388,7 +386,7 @@ setup(){
388
386
  pkg_dir="$(dirname $pkg_dir)/current"
389
387
  fi
390
388
 
391
- if [ -d "$pkg_dir/bin/" ]; then
389
+ if [ -d "$pkg_dir/bin/" -o -d "$pkg_dir/usr/local/bin/" ]; then
392
390
 
393
391
  for exe in ` find "$pkg_dir/bin/" -maxdepth 1 -type f -executable`; do
394
392
  exe=$(basename $exe)
@@ -396,10 +394,17 @@ setup(){
396
394
  link "$pkg_dir/bin/$exe" "$OPT_DIR/bin/$exe" 2>/dev/null
397
395
  done
398
396
 
397
+ for exe in ` find "$pkg_dir/usr/local/bin/" -maxdepth 1 -type f -executable`; do
398
+ exe=$(basename $exe)
399
+ rm -f "$OPT_DIR/usr/local/bin/$exe"
400
+ link "$pkg_dir/usr/local/bin/$exe" "$OPT_DIR/bin/$exe" 2>/dev/null
401
+ done
402
+
403
+
399
404
  else
400
405
  local old_pwd="`expand_path $(pwd)`"
401
406
 
402
- for exe in ` find "$pkg_dir/" "$pkg_dir/src/" -maxdepth 1 -type f -executable`; do
407
+ for exe in ` find "$pkg_dir/" "$pkg_dir/source/" "$pkg_dir/src/" -maxdepth 1 -type f -executable`; do
403
408
  orig=$exe
404
409
  exe=$(basename $exe)
405
410
  echo "EXE $exe"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbbt-util
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.26.20
4
+ version: 5.26.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Vazquez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-06-19 00:00:00.000000000 Z
11
+ date: 2019-06-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake