pkg-wizard 0.1.15 → 0.1.16

Sign up to get free protection for your applications and to get access to all the features.
@@ -97,13 +97,15 @@ module PKGWizard
97
97
  snapshots = Dir["snapshot/snapshot*"].size
98
98
  sjobs = Dir["output/job*"].size
99
99
  qjobs = Dir["incoming/*.src.rpm"].size
100
+ cjobs = Dir["workspace/job_*"].size
100
101
  total_jobs = fjobs + sjobs
101
102
  {
102
103
  :failed_jobs => fjobs,
103
104
  :successful_jobs => sjobs,
104
105
  :enqueued => qjobs,
105
106
  :total_jobs => total_jobs,
106
- :snapshots => snapshots
107
+ :snapshots => snapshots,
108
+ :building => cjobs
107
109
  }.to_yaml
108
110
  end
109
111
 
@@ -251,11 +253,16 @@ module PKGWizard
251
253
  end
252
254
  end
253
255
 
256
+ # Build queue
254
257
  scheduler = Rufus::Scheduler.start_new
255
258
  scheduler.every '2s', :blocking => true do
256
259
  meta[:start_time] = Time.now
257
260
  queue = Dir['incoming/*.src.rpm'].sort_by {|filename| File.mtime(filename) }
258
261
  if not queue.empty?
262
+ # Clean workspace first
263
+ Dir["workspace/job_*"].each do |j|
264
+ FileUtils.rm_rf j
265
+ end
259
266
  job_dir = "workspace/job_#{Time.now.strftime '%Y%m%d_%H%M%S'}"
260
267
  qfile = File.join(job_dir, File.basename(queue.first))
261
268
  job_time = Time.now.strftime '%Y%m%d_%H%M%S'
data/lib/pkg-wizard.rb CHANGED
@@ -4,7 +4,7 @@ require 'mixlib/cli'
4
4
 
5
5
  module PKGWizard
6
6
 
7
- VERSION = '0.1.15'
7
+ VERSION = '0.1.16'
8
8
 
9
9
  class Distribution
10
10
  def self.detect
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pkg-wizard
3
3
  version: !ruby/object:Gem::Version
4
- hash: 5
4
+ hash: 59
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 15
10
- version: 0.1.15
9
+ - 16
10
+ version: 0.1.16
11
11
  platform: ruby
12
12
  authors:
13
13
  - Sergio Rubio
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-03-10 00:00:00 +01:00
18
+ date: 2011-03-15 00:00:00 +01:00
19
19
  default_executable: pkgwiz
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency