Commit f3c7a21c472f6d0f53f9f2cec5c4c1bb673897a5
1 parent
d2bc5b9d
Exists in
master
and in
2 other branches
only compare versions against git ones
Showing
3 changed files
with
19 additions
and
11 deletions
Show diff stats
README.md
@@ -11,7 +11,7 @@ Note that this app consists of a single PSGI script, a template file and Bootstr | @@ -11,7 +11,7 @@ Note that this app consists of a single PSGI script, a template file and Bootstr | ||
11 | In order to use this app you will need perl 5 and the following perl modules installed: | 11 | In order to use this app you will need perl 5 and the following perl modules installed: |
12 | 12 | ||
13 | Plack | 13 | Plack |
14 | -LWP::Simple | 14 | +LWP::UserAgent |
15 | JSON | 15 | JSON |
16 | Text::Template | 16 | Text::Template |
17 | 17 |
spb_copr_status.psgi
@@ -59,19 +59,27 @@ sub info2html { | @@ -59,19 +59,27 @@ sub info2html { | ||
59 | my $table_entries=""; | 59 | my $table_entries=""; |
60 | foreach my $key (%{$info}) { | 60 | foreach my $key (%{$info}) { |
61 | next if(ref($key) eq 'HASH'); | 61 | next if(ref($key) eq 'HASH'); |
62 | - my $fill_row; | ||
63 | - if($info->{$key}->{'v4_version'} eq $info->{$key}->{'v5_version'} && $info->{$key}->{'v4_version'} eq $info->{$key}->{git_version}) { | ||
64 | - $fill_row = "success"; | 62 | + my $fill_v4_row; |
63 | + my $fill_v5_row; | ||
64 | + if($info->{$key}->{'v4_version'} eq $info->{$key}->{git_version}) { | ||
65 | + $fill_v4_row = "success"; | ||
65 | } | 66 | } |
66 | else { | 67 | else { |
67 | - $fill_row = "danger"; | 68 | + $fill_v4_row = "danger"; |
68 | } | 69 | } |
69 | 70 | ||
70 | - $table_entries .= "<tr class=\"$fill_row\"> | ||
71 | - <td>$key</td> | ||
72 | - <td>$info->{$key}->{'v4_version'}</td> | ||
73 | - <td>$info->{$key}->{'v5_version'}</td> | 71 | + if($info->{$key}->{'v5_version'} eq $info->{$key}->{git_version}) { |
72 | + $fill_v5_row = "success"; | ||
73 | + } | ||
74 | + else { | ||
75 | + $fill_v5_row = "danger"; | ||
76 | + } | ||
77 | + | ||
78 | + $table_entries .= "<tr> | ||
79 | + <td><b>$key</b></td> | ||
74 | <td>$info->{$key}->{'git_version'}</td> | 80 | <td>$info->{$key}->{'git_version'}</td> |
81 | + <td class=\"$fill_v4_row\">$info->{$key}->{'v4_version'}</td> | ||
82 | + <td class=\"$fill_v5_row\">$info->{$key}->{'v5_version'}</td> | ||
75 | </tr>"; | 83 | </tr>"; |
76 | } | 84 | } |
77 | 85 |
template.html.tt
@@ -27,7 +27,7 @@ | @@ -27,7 +27,7 @@ | ||
27 | </div> | 27 | </div> |
28 | 28 | ||
29 | <div class="jumbotron"> | 29 | <div class="jumbotron"> |
30 | - <p class="lead">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 (<b>note that this is NOT necessarily a bad thing</b>).</p> | 30 | + <p class="lead">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 (<b>note that this is NOT necessarily a bad thing</b>).</p> |
31 | <div class="row"> | 31 | <div class="row"> |
32 | <div class="col-md-6 col-md-offset-3"> | 32 | <div class="col-md-6 col-md-offset-3"> |
33 | <table class="table table-striped"> | 33 | <table class="table table-striped"> |
@@ -45,9 +45,9 @@ | @@ -45,9 +45,9 @@ | ||
45 | <table class="table table-striped"> | 45 | <table class="table table-striped"> |
46 | <tr> | 46 | <tr> |
47 | <th>PACKAGE</th> | 47 | <th>PACKAGE</th> |
48 | + <th>git</th> | ||
48 | <th>softwarepublico/v4</th> | 49 | <th>softwarepublico/v4</th> |
49 | <th>softwarepublico/v5</th> | 50 | <th>softwarepublico/v5</th> |
50 | - <th>git</th> | ||
51 | </tr> | 51 | </tr> |
52 | {$table_entries} | 52 | {$table_entries} |
53 | </table> | 53 | </table> |