From f3c7a21c472f6d0f53f9f2cec5c4c1bb673897a5 Mon Sep 17 00:00:00 2001 From: Athos Ribeiro Date: Mon, 2 Nov 2015 11:26:02 -0200 Subject: [PATCH] only compare versions against git ones --- README.md | 2 +- spb_copr_status.psgi | 24 ++++++++++++++++-------- template.html.tt | 4 ++-- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index d7d3f65..0b47e55 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Note that this app consists of a single PSGI script, a template file and Bootstr In order to use this app you will need perl 5 and the following perl modules installed: Plack -LWP::Simple +LWP::UserAgent JSON Text::Template diff --git a/spb_copr_status.psgi b/spb_copr_status.psgi index 53166dd..5199f5a 100644 --- a/spb_copr_status.psgi +++ b/spb_copr_status.psgi @@ -59,19 +59,27 @@ sub info2html { my $table_entries=""; foreach my $key (%{$info}) { next if(ref($key) eq 'HASH'); - my $fill_row; - if($info->{$key}->{'v4_version'} eq $info->{$key}->{'v5_version'} && $info->{$key}->{'v4_version'} eq $info->{$key}->{git_version}) { - $fill_row = "success"; + my $fill_v4_row; + my $fill_v5_row; + if($info->{$key}->{'v4_version'} eq $info->{$key}->{git_version}) { + $fill_v4_row = "success"; } else { - $fill_row = "danger"; + $fill_v4_row = "danger"; } - $table_entries .= " - $key - $info->{$key}->{'v4_version'} - $info->{$key}->{'v5_version'} + if($info->{$key}->{'v5_version'} eq $info->{$key}->{git_version}) { + $fill_v5_row = "success"; + } + else { + $fill_v5_row = "danger"; + } + + $table_entries .= " + $key $info->{$key}->{'git_version'} + $info->{$key}->{'v4_version'} + $info->{$key}->{'v5_version'} "; } diff --git a/template.html.tt b/template.html.tt index 33d28d3..4d2c5cc 100644 --- a/template.html.tt +++ b/template.html.tt @@ -27,7 +27,7 @@
-

This app fetches data from softwarepublico Copr EPEL7 repositories and compares package versions. In short, red rows mean package versions differ among the repositories and/or git (note that this is NOT necessarily a bad thing).

+

This app fetches data from softwarepublico Copr EPEL7 repositories and compares package versions. In short, a red cell means that the package version differ from the git one (note that this is NOT necessarily a bad thing).

@@ -45,9 +45,9 @@
+ - {$table_entries}
PACKAGEgit softwarepublico/v4 softwarepublico/v5git
-- libgit2 0.21.2