rbbt-util 5.26.11 → 5.26.12

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
  SHA256:
3
- metadata.gz: 47c3a5304ab04d9f3b75b8f26350ddcb26473ddb7e3448eeeb412c838b04cb5e
4
- data.tar.gz: d709e752b74d99ebe5393a16fdab296a936998a8376536a9315ecf7c4e30263d
3
+ metadata.gz: 5a26934f329b7164d590e5e56b3c652395aed839642f30143c6f73cb42b4de12
4
+ data.tar.gz: ec812f3cd06f25081bfdcd0bff71a8382a8813d69ecb91ecf84a7df5c4d01899
5
5
  SHA512:
6
- metadata.gz: 1877924f85a5db0f199cc6fb26be19af74c41a29070583984015757bdde8d487e380fd35deab8dca918a1ee00cca610dded6dd5cd427c2c63b8a09ab283ad6ed
7
- data.tar.gz: 24b91de30df2ec4426b75373eb0bde9a0e267b58f3ee761b8590777a0ffbe0454a6f7a0db46aad012e368941bc4608ebb1da4d5633f098c0c534e07ce759fe66
6
+ metadata.gz: 1da22127c3b3674fd0c96d43d86355b1c79d9dcb75a7f6b82ed22f147530f6cef618b425cc556dcbe7ddd810e5c1ef05d44bef86c978f51ff29613ad8a0f33cd
7
+ data.tar.gz: c79ba4273b3c50625976d6a07cb9545bdd7a5e42380cab89cbe12f0ab28cd452238e61c937e16e558889f78e6f35f77b083413a389d7a44cd02e56b212880e35
data/lib/rbbt/monitor.rb CHANGED
@@ -177,7 +177,8 @@ module Rbbt
177
177
 
178
178
  CMD.cmd(cmd, :pipe => true).read.split("\n")
179
179
  end
180
- files = files.sort_by{|f| Open.mtime f}
180
+
181
+ files = files.sort_by{|f| Open.mtime(f) || Time.now}
181
182
  TSV.traverse files, :type => :array, :into => jobs, :_bar => "Finding jobs in #{ taskdir }" do |file|
182
183
  _files << file
183
184
  if m = file.match(/(.*)\.(info|pid|files)$/)
data/lib/rbbt/resource.rb CHANGED
@@ -63,9 +63,6 @@ module Resource
63
63
  @resources[path] = [type, content || block]
64
64
 
65
65
  if type == :install
66
- Log.debug "Preparing software: #{path}"
67
- $set_software_env = false unless path.exists?
68
- path.produce
69
66
  software_dir = path.resource.root.software
70
67
  set_software_env(software_dir) unless $set_software_env
71
68
  $set_software_env = true
@@ -192,6 +189,9 @@ module Resource
192
189
  run_rake(path, content, rake_dir)
193
190
  when :install
194
191
  Log.debug "Installing software: #{path}"
192
+
193
+ $set_software_env = false unless File.exists? path
194
+
195
195
  software_dir = path.resource.root.software.find :user
196
196
  helper_file = File.expand_path(Rbbt.share.install.software.lib.install_helpers.find(:lib, caller_lib_dir(__FILE__)))
197
197
  #helper_file = File.expand_path(Rbbt.share.install.software.lib.install_helpers.find)
@@ -208,7 +208,8 @@ source "$INSTALL_HELPER_FILE"
208
208
  script = preamble + "\n" + Open.read(content)
209
209
  CMD.cmd_log('bash', :in => script)
210
210
 
211
- set_software_env(software_dir)
211
+ set_software_env(software_dir) unless $set_software_env
212
+ $set_software_env = true
212
213
  else
213
214
  raise "Could not produce #{ resource }. (#{ type }, #{ content })"
214
215
  end
@@ -382,6 +382,7 @@ setup(){
382
382
  pkg_dir="$(dirname $pkg_dir)/current"
383
383
  fi
384
384
 
385
+ echo $pkg_dir
385
386
  if [ -d "$pkg_dir/bin/" ]; then
386
387
 
387
388
  for exe in ` find "$pkg_dir/bin/" -maxdepth 1 -type f -executable`; do
@@ -406,11 +407,12 @@ setup(){
406
407
  ([ -d "$pkg_dir/lib" ] && add2file "$OPT_DIR/.ld-paths" "$pkg_dir/lib")
407
408
  ([ -d "$pkg_dir/lib64" ] && add2file "$OPT_DIR/.ld-paths" "$pkg_dir/lib64")
408
409
  ([ -d "$pkg_dir/lib/pkgconfig" ] && add2file "$OPT_DIR/.pkgconfig-paths" "$pkg_dir/lib/pkgconfig")
410
+ echo $name setup
409
411
  }
410
412
 
411
413
  #{{{ HELPERS
412
414
 
413
- prepare_src_pkg(){
415
+ prepare_pkg(){
414
416
  local name="$1"
415
417
  local url="$2"
416
418
  shift;shift;
@@ -425,7 +427,7 @@ install_src(){
425
427
  shift;shift;
426
428
  local extra="$@"
427
429
 
428
- prepare_src_pkg "$name" "$url"
430
+ prepare_pkg "$name" "$url"
429
431
  build "$name" "$extra"
430
432
  }
431
433
 
@@ -7,14 +7,18 @@ $0 = "rbbt #{$previous_commands*""} #{ File.basename(__FILE__) }" if $previous_c
7
7
  options = SOPT.setup <<EOF
8
8
  Calculate density
9
9
 
10
- $ rbbt stat density <file>
10
+ $ rbbt stat density <file> <plot>
11
11
 
12
12
  -h--help Help
13
+ -m--max* Upper limit
13
14
  EOF
14
15
 
15
16
  SOPT.usage if options[:help]
16
17
 
17
18
  file = ARGV.shift
19
+ plot = ARGV.shift
20
+
21
+ file, plot = ["-", file] if plot.nil? and file.include? '.png'
18
22
 
19
23
  if file == '-' or file.nil?
20
24
  file = STDIN
@@ -22,15 +26,26 @@ else
22
26
  file = Open.open file
23
27
  end
24
28
 
29
+
25
30
  values = file.read.split("\n").collect{|v| v.to_f}
31
+ max = options[:max]
32
+
26
33
 
27
34
  res = TmpFile.with_file nil, :extension => 'png' do |tmp|
28
- R.run <<-EOF
35
+ if max
36
+ R.run <<-EOF
37
+ values = #{R.ruby2R values}
38
+ d = density(values)
39
+ rbbt.png_plot(filename = '#{plot || tmp}', 'plot(d, xlim=c(0,#{max})); abline(v=mean(values))')
40
+ EOF
41
+ else
42
+ R.run <<-EOF
29
43
  values = #{R.ruby2R values}
30
44
  d = density(values)
31
- rbbt.png_plot(filename = '#{tmp}', 'plot(d)')
32
- EOF
45
+ rbbt.png_plot(filename = '#{plot || tmp}', 'plot(d); abline(v=mean(values))')
46
+ EOF
47
+ end
33
48
 
34
- `op '#{tmp}'`
49
+ `op '#{plot || tmp}'`
35
50
  end
36
51
 
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.11
4
+ version: 5.26.12
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-05-23 00:00:00.000000000 Z
11
+ date: 2019-05-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake