rbbt-util 5.13.33 → 5.13.34

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: ac193605daa68792b87762023e090b4f20b51636
4
- data.tar.gz: cff3c91f834c396cfbe8c0c9f65cd046aaff8ffc
3
+ metadata.gz: 1581db188b182a19a32b933fa09143b05a63f673
4
+ data.tar.gz: 4ff0988f92691a719fa4e5d255f5e91bde236ac5
5
5
  SHA512:
6
- metadata.gz: 53ca452d6922e58d4f447b37c8dbe42580bc72ee470b2400eeb5cfd1e046f29ec42432295670203040fddf95d546e5f83059aee1e3044f501b8b9d9cab3195be
7
- data.tar.gz: 882d73bd8b7b3c025ba441af4f42dfc7b047a7f29ca4aa14456e9733e8ce82e863956c987d35a077d6a6a69bd8e0a9189419fc6f7b96d84bc4cae0d7deb34c4d
6
+ metadata.gz: b0b93bb3972edb714994d0e5086f8d4e6d469cd719de7ab453fc36dc5f4b4a9bd98b80028f918ba1beb2d916678af9d467492ec8767477d874fcc8dc589bc651
7
+ data.tar.gz: 3e46304432334c7fab8b8e95425794cec108b8dd80c4e598e5a7ad017eb31cd70c5a202997785ca1178a32dbb4fd839f50a2b4ca980b91f0ad1f8b0a656e5105
@@ -218,7 +218,7 @@ module Persist
218
218
 
219
219
  if stream
220
220
  if persist_options[:no_load] == :stream
221
- res = tee_stream(stream, path, type, stream.respond_to?(:callback)? stream.callback : nil, stream.respond_to?(:abort_callback)? stream.abort_callback : nil, lockfile)
221
+ res = tee_stream(stream, path, type, stream.respond_to?(:callback)? stream.callback : nil, stream.respond_to?(:abort_callback)? stream.abort_callback : nil)
222
222
  res.lockfile = lockfile
223
223
 
224
224
  raise KeepLocked.new res
@@ -54,7 +54,7 @@ module Persist
54
54
 
55
55
  def write_and_read
56
56
  lock_filename = Persist.persistence_path(persistence_path + '.write', {:dir => TSV.lock_dir})
57
- mutex.synchronize do
57
+ #mutex.synchronize do
58
58
  Misc.lock(lock_filename, true, :max_age => 600) do
59
59
  write if closed? or not write?
60
60
  res = begin
@@ -64,12 +64,12 @@ module Persist
64
64
  end
65
65
  res
66
66
  end
67
- end
67
+ #end
68
68
  end
69
69
 
70
70
  def write_and_close
71
71
  lock_filename = Persist.persistence_path(persistence_path + '.write', {:dir => TSV.lock_dir})
72
- mutex.synchronize do
72
+ #mutex.synchronize do
73
73
  Misc.lock(lock_filename, true) do
74
74
  write if closed? or not write?
75
75
  res = begin
@@ -82,19 +82,19 @@ module Persist
82
82
  end
83
83
  res
84
84
  end
85
- end
85
+ #end
86
86
  end
87
87
 
88
88
  def read_and_close
89
- mutex.synchronize do
90
- read if closed? or not read?
91
- res = begin
92
- yield
93
- ensure
94
- close
95
- end
96
- res
97
- end
89
+ #mutex.synchronize do
90
+ read if closed? or not read?
91
+ res = begin
92
+ yield
93
+ ensure
94
+ close
95
+ end
96
+ res
97
+ #end
98
98
  end
99
99
 
100
100
 
@@ -186,6 +186,7 @@ module CMD
186
186
  end
187
187
 
188
188
  sin.close unless sin.closed?
189
+ in_content.join if in_content.respond_to? :join and not dont_close_in
189
190
  in_content.close unless in_content.closed? or dont_close_in
190
191
  rescue
191
192
  Process.kill "INT", pid
@@ -17,7 +17,7 @@ module Log
17
17
  end
18
18
 
19
19
  def self.ignore_stderr
20
- LOG_MUTEX.synchronize do
20
+ #LOG_MUTEX.synchronize do
21
21
  backup_stderr = STDERR.dup
22
22
  File.open('/dev/null', 'w') do |f|
23
23
  STDERR.reopen(f)
@@ -28,7 +28,7 @@ module Log
28
28
  backup_stderr.close
29
29
  end
30
30
  end
31
- end
31
+ #end
32
32
  end
33
33
 
34
34
  def self.get_level(level)
@@ -10,11 +10,11 @@ module Log
10
10
 
11
11
  def print(io, str)
12
12
  return if ENV["RBBT_NO_PROGRESS"] == "true"
13
- LOG_MUTEX.synchronize do
13
+ #LOG_MUTEX.synchronize do
14
14
  STDERR.print str
15
15
  Log.logfile.puts str unless Log.logfile.nil?
16
16
  Log::LAST.replace "progress"
17
- end
17
+ #end
18
18
  end
19
19
 
20
20
  attr_accessor :history, :mean_max
@@ -96,7 +96,7 @@ module Log
96
96
  else
97
97
  bars = BARS
98
98
  end
99
- print(io, up_lines(bars.length) << Log.color(:yellow, "--Progress\n") << down_lines(bars.length))
99
+ print(io, up_lines(bars.length) << Log.color(:yellow, "...Progress\n") << down_lines(bars.length))
100
100
  print(io, up_lines(@depth) << report_msg << down_lines(@depth))
101
101
  @last_time = Time.now
102
102
  @last_count = ticks
@@ -12,7 +12,7 @@ module Misc
12
12
  class << self
13
13
  attr_accessor :sensiblewrite_dir
14
14
  def sensiblewrite_dir
15
- @sensiblewrite_dir = Rbbt.tmp.sensiblewrite
15
+ @sensiblewrite_dir = Rbbt.tmp.sensiblewrite.find
16
16
  end
17
17
  end
18
18
 
@@ -171,7 +171,8 @@ module Misc
171
171
  else
172
172
  Log.medium "Consuming stream #{Misc.fingerprint io}"
173
173
  begin
174
- while not io.closed? and block = io.read(2048)
174
+ into.sync == true if IO === into
175
+ while not io.closed? and block = io.read(2048 * 10)
175
176
  into << block if into
176
177
  end
177
178
  io.join if io.respond_to? :join
@@ -212,10 +213,12 @@ module Misc
212
213
  lock_options = Misc.pull_keys options, :lock
213
214
  lock_options = lock_options[:lock] if Hash === lock_options[:lock]
214
215
  return if Open.exists? path
215
- tmp_path = Persist.persistence_path(path, {:dir => Misc.sensiblewrite_lock_dir})
216
- Misc.lock tmp_path, lock_options do
216
+ tmp_path = Persist.persistence_path(path, {:dir => Misc.sensiblewrite_dir})
217
+ tmp_path_lock = Persist.persistence_path(path, {:dir => Misc.sensiblewrite_lock_dir})
218
+ Misc.lock tmp_path_lock, lock_options do
217
219
  return if Open.exists? path
218
220
  if not Open.exists? path
221
+ FileUtils.mkdir_p File.dirname(tmp_path) unless File.directory? File.dirname(tmp_path)
219
222
  FileUtils.rm_f tmp_path if File.exists? tmp_path
220
223
  begin
221
224
  case
@@ -367,9 +367,8 @@ module Open
367
367
  file_open(in_cache(url, wget_options), options[:grep], mode, options[:invert_grep])
368
368
  else
369
369
  io = wget(url, wget_options)
370
- new, save = Misc.tee_stream io
371
- add_cache(url, save, wget_options)
372
- new
370
+ add_cache(url, io, wget_options)
371
+ file_open(in_cache(url, wget_options), options[:grep], mode, options[:invert_grep])
373
372
  end
374
373
  io = unzip(io) if ((String === url and zip?(url)) and not options[:noz]) or options[:zip]
375
374
  io = gunzip(io) if ((String === url and gzip?(url)) and not options[:noz]) or options[:gzip]
@@ -35,7 +35,7 @@ class Step
35
35
  @mutex = Mutex.new
36
36
  @info_mutex = Mutex.new
37
37
  @inputs = inputs || []
38
- NamedArray.setup @inputs, task.inputs
38
+ NamedArray.setup @inputs, task.inputs if task
39
39
  end
40
40
 
41
41
  def inputs
@@ -140,7 +140,7 @@ class Step
140
140
  next if dependency.running?
141
141
  dependency.clean
142
142
  else
143
- dependency.clean if (dependency.error? or dependency.aborted? or dependency.status.nil?)# or not dependency.done?)
143
+ dependency.clean if (dependency.error? or dependency.aborted? or dependency.status.nil? or not (dependency.done? or dependency.running?))
144
144
  end
145
145
 
146
146
  unless dependency.started? #dependency.result or dependency.done?
@@ -59,20 +59,21 @@ end
59
59
 
60
60
  puts Log.color(:magenta, "# System report")
61
61
  puts
62
- sort_file = Proc.new do |f,i|
63
- dir = f.split(/:\_/).first
64
-
65
- dir + i[:ctime].to_i.to_s
66
- end
67
- locks = Rbbt.lock_info
68
- if locks.any?
69
- puts Log.color(:magenta, "Locks:")
70
- #locks.sort_by{|f,i| i[:ctime] }.each do |file,info|
71
- locks.sort_by(&sort_file).each do |file,info|
72
- elapsed, pid, ppid = info.values_at :elapsed, :pid, :ppid
73
- puts " " << file + Log.color(:blue, " -- time: #{Misc.format_seconds elapsed}; ppid: #{ppid}; pid: #{pid_msg pid}")
62
+ sort_files = Proc.new do |a,b|
63
+ fa,ia = a
64
+ fb,ib = b
65
+
66
+ dira = fa.split(/[:_][^\/>]*$/).first
67
+ dirb = fb.split(/[:_][^\/>]*$/).first
68
+
69
+ case dira <=> dirb
70
+ when -1
71
+ -1
72
+ when 1
73
+ 1
74
+ else
75
+ ia[:ctime] <=> ib[:ctime]
74
76
  end
75
- puts
76
77
  end
77
78
 
78
79
 
@@ -96,6 +97,16 @@ if sensiblewrites.any?
96
97
  puts
97
98
  end
98
99
 
100
+ locks = Rbbt.lock_info
101
+ if locks.any?
102
+ puts Log.color(:magenta, "Locks:")
103
+ locks.sort(&sort_files).each do |file,info|
104
+ elapsed, pid, ppid = info.values_at :elapsed, :pid, :ppid
105
+ puts " " << file + Log.color(:blue, " -- time: #{Misc.format_seconds elapsed}; ppid: #{ppid}; pid: #{pid_msg pid}")
106
+ end
107
+ puts
108
+ end
109
+
99
110
  exit 0 if workflow.nil?
100
111
  workflow = nil if workflow == ["all"]
101
112
 
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.13.33
4
+ version: 5.13.34
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Vazquez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-06 00:00:00.000000000 Z
11
+ date: 2014-06-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake