aboutsummaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorPeter Wilmott <p@p8952.info>2015-03-22 21:48:43 +0000
committerPeter Wilmott <p@p8952.info>2015-03-22 21:48:43 +0000
commita724ee5141bd161cd768dc2d5e8d8f11b29fd09d (patch)
treea0610ca53b3d71646c6a0baafc18d82ea7fa6aad /web
parentAdd new_targets page (diff)
downloadruby-tinderbox-a724ee5141bd161cd768dc2d5e8d8f11b29fd09d.tar.gz
ruby-tinderbox-a724ee5141bd161cd768dc2d5e8d8f11b29fd09d.tar.bz2
ruby-tinderbox-a724ee5141bd161cd768dc2d5e8d8f11b29fd09d.zip
Exit early if one factor is nil, force the ordering of packages
Diffstat (limited to 'web')
-rw-r--r--web/app.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/web/app.rb b/web/app.rb
index f6024ad..661d0dd 100644
--- a/web/app.rb
+++ b/web/app.rb
@@ -85,17 +85,19 @@ class RubyTinderbox < Sinatra::Base
packages = []
Package.each do |package|
build_current = package.build_dataset.where(target: 'current').reverse_order(:timestamp).first
- repoman_current = package.repoman_dataset.where(target: 'current').reverse_order(:timestamp).first
- repoman_next = package.repoman_dataset.where(target: 'next').reverse_order(:timestamp).first
-
next if build_current.nil?
+
+ repoman_current = package.repoman_dataset.where(target: 'current').reverse_order(:timestamp).first
next if repoman_current.nil?
+
+ repoman_next = package.repoman_dataset.where(target: 'next').reverse_order(:timestamp).first
next if repoman_next.nil?
if repoman_current[:result] == 'passed' and repoman_next[:result] == 'passed'
packages << [package, build_current, nil, repoman_current, repoman_next]
end
end
+ packages = packages.compact.sort_by { |package| package[0][:identifier] }
erb :'bumps/new_targets', locals: { packages: packages, update_timestamp: update_timestamp, portage_timestamp: portage_timestamp }
end