autobuild 1.7.12.rc5 → 1.7.12.rc6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/autobuild/package.rb +1 -0
- data/lib/autobuild/parallel.rb +20 -12
- data/lib/autobuild/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2adc58accd29a554c2853a23fe117ea15e021263
|
4
|
+
data.tar.gz: f5c20d74ad6ab876b0f20e0edd3f4a6137cac1c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb1d9df085fee0ee0e9b1fcf89497d57c09b2be06ef3559725f54135b367f9b468a2332078fb0246969218b2e533af7ef824cb9fd9354009055eeb22f212369e
|
7
|
+
data.tar.gz: c01f8ded6b0a6ab6a5bb15e7c96c5515ddf6802ec9c1b1c9f99a8a16310ed06203d160a1e6d5ae24cd4adbc743e377dc4f57150e61ccbff19d3ad75902dca511
|
data/lib/autobuild/package.rb
CHANGED
@@ -476,6 +476,7 @@ module Autobuild
|
|
476
476
|
# and installed.
|
477
477
|
def depends_on(*packages)
|
478
478
|
packages.each do |p|
|
479
|
+
p = p.name if p.respond_to?(:name)
|
479
480
|
raise ArgumentError, "#{p.inspect} should be a string" if !p.respond_to? :to_str
|
480
481
|
p = p.to_str
|
481
482
|
next if p == name
|
data/lib/autobuild/parallel.rb
CHANGED
@@ -79,14 +79,14 @@ module Autobuild
|
|
79
79
|
attr_reader :reverse_dependencies
|
80
80
|
attr_reader :processed
|
81
81
|
attr_reader :started_packages
|
82
|
-
attr_reader :
|
82
|
+
attr_reader :active_tasks
|
83
83
|
attr_reader :queue
|
84
84
|
attr_reader :priorities
|
85
85
|
|
86
86
|
def initialize(reverse_dependencies)
|
87
87
|
@reverse_dependencies = reverse_dependencies
|
88
88
|
@processed = Set.new
|
89
|
-
@
|
89
|
+
@active_tasks = Set.new
|
90
90
|
@priorities = Hash.new
|
91
91
|
@started_packages = Hash.new
|
92
92
|
@queue = Hash.new
|
@@ -94,7 +94,8 @@ module Autobuild
|
|
94
94
|
|
95
95
|
def push(task, base_priority = 1)
|
96
96
|
if task.respond_to?(:package)
|
97
|
-
|
97
|
+
started_packages[task.package] ||= -started_packages.size
|
98
|
+
queue[task] = started_packages[task.package]
|
98
99
|
else queue[task] = base_priority
|
99
100
|
end
|
100
101
|
end
|
@@ -113,25 +114,32 @@ module Autobuild
|
|
113
114
|
end
|
114
115
|
|
115
116
|
def mark_as_active(pending_task)
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
117
|
+
active_tasks << pending_task
|
118
|
+
end
|
119
|
+
|
120
|
+
def active_task?(task)
|
121
|
+
active_tasks.include?(task)
|
120
122
|
end
|
121
123
|
|
122
124
|
def ready?(task)
|
123
125
|
task.prerequisite_tasks.all? do |t|
|
124
|
-
t
|
126
|
+
already_processed?(t)
|
125
127
|
end
|
126
128
|
end
|
127
129
|
|
130
|
+
def already_processed?(task)
|
131
|
+
task.already_invoked? && !active_task?(task)
|
132
|
+
end
|
133
|
+
|
134
|
+
def needs_processing?(task)
|
135
|
+
!task.already_invoked? && !active_task?(task)
|
136
|
+
end
|
137
|
+
|
128
138
|
def process_finished_task(task)
|
129
|
-
|
130
|
-
active_packages.delete(task.package)
|
131
|
-
end
|
139
|
+
active_tasks.delete(task)
|
132
140
|
processed << task
|
133
141
|
reverse_dependencies[task].each do |candidate|
|
134
|
-
if
|
142
|
+
if needs_processing?(candidate) && ready?(candidate)
|
135
143
|
push(candidate, priorities[task])
|
136
144
|
end
|
137
145
|
end
|
data/lib/autobuild/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: autobuild
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.7.12.
|
4
|
+
version: 1.7.12.rc6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sylvain Joyeux
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-10-
|
11
|
+
date: 2014-10-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|