Commit ae7d8cda06b28e8aaedf7ce949a8282295c43fd0
1 parent
e8d76b8d
Exists in
master
remove all hard coded reposotiries and branches
Showing
1 changed file
with
9 additions
and
9 deletions
Show diff stats
lib/CoprStatus.pm
... | ... | @@ -71,7 +71,7 @@ sub get_specs { |
71 | 71 | my $release = 'no_release'; |
72 | 72 | $release = $1 if $spec =~ /^Release:\s*([^\s]+)\s*$/m; |
73 | 73 | $version = "$version-$release"; |
74 | - $info->{$package}->{'git_version_'.$branch} = $version; | |
74 | + $info->{$package}->{'git'}->{$branch} = $version; | |
75 | 75 | } |
76 | 76 | } |
77 | 77 | |
... | ... | @@ -87,7 +87,7 @@ sub get_copr_versions { |
87 | 87 | my $package = $_->{'pkg_name'}; |
88 | 88 | my $status = $_->{'results'}{'epel-7-x86_64'}{'status'}; |
89 | 89 | my $version = $_->{'results'}{'epel-7-x86_64'}{'pkg_version'}; |
90 | - $info->{$package}->{$repo."_version"} = $version if $status eq "succeeded"; | |
90 | + $info->{$package}->{'copr'}->{$repo} = $version if $status eq "succeeded"; | |
91 | 91 | } |
92 | 92 | } |
93 | 93 | |
... | ... | @@ -123,7 +123,7 @@ sub compare_versions { |
123 | 123 | update_info(); |
124 | 124 | my $match = {}; |
125 | 125 | foreach my $package (keys %{$info}) { |
126 | - if($info->{$package}->{'v5_version'} eq $info->{$package}->{git_version_master}) { | |
126 | + if($info->{$package}->{'copr'}->{${$config->{Repositories}}[1]} eq $info->{$package}->{'git'}->{${$config->{Branches}}[1]}) { | |
127 | 127 | $match->{$package} = 1; |
128 | 128 | } |
129 | 129 | else { |
... | ... | @@ -140,14 +140,14 @@ sub info2html { |
140 | 140 | foreach my $package (keys %{$info}) { |
141 | 141 | my $fill_v4_row; |
142 | 142 | my $fill_v5_row; |
143 | - if($info->{$package}->{'v4_version'} eq $info->{$package}->{'git_version_stable-4.2'}) { | |
143 | + if($info->{$package}->{'copr'}->{${$config->{Repositories}}[0]} eq $info->{$package}->{'git'}->{${$config->{Branches}}[0]}) { | |
144 | 144 | $fill_v4_row = "success"; |
145 | 145 | } |
146 | 146 | else { |
147 | 147 | $fill_v4_row = "danger"; |
148 | 148 | } |
149 | 149 | |
150 | - if($info->{$package}->{'v5_version'} eq $info->{$package}->{git_version_master}) { | |
150 | + if($info->{$package}->{'copr'}->{${$config->{Repositories}}[1]} eq $info->{$package}->{'git'}->{${$config->{Branches}}[1]}) { | |
151 | 151 | $fill_v5_row = "success"; |
152 | 152 | } |
153 | 153 | else { |
... | ... | @@ -156,10 +156,10 @@ sub info2html { |
156 | 156 | |
157 | 157 | $table_entries .= "<tr> |
158 | 158 | <td><b>$package</b></td> |
159 | - <td>$info->{$package}->{'git_version_stable-4.2'}</td> | |
160 | - <td class=\"$fill_v4_row\">$info->{$package}->{'v4_version'}</td> | |
161 | - <td>$info->{$package}->{'git_version_master'}</td> | |
162 | - <td class=\"$fill_v5_row\">$info->{$package}->{'v5_version'}</td> | |
159 | + <td>$info->{$package}->{'git'}->{${$config->{Branches}}[0]}</td> | |
160 | + <td class=\"$fill_v4_row\">$info->{$package}->{'copr'}->{${$config->{Repositories}}[0]}</td> | |
161 | + <td>$info->{$package}->{'git'}->{${$config->{Branches}}[1]}</td> | |
162 | + <td class=\"$fill_v5_row\">$info->{$package}->{'copr'}->{${$config->{Repositories}}[1]}</td> | |
163 | 163 | </tr>"; |
164 | 164 | } |
165 | 165 | ... | ... |