aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Thauvin <nanardon@mageia.org>2010-10-21 06:13:21 +0000
committerOlivier Thauvin <nanardon@mageia.org>2010-10-21 06:13:21 +0000
commit3f2d223640af766ef2fdeb37a7acf36af602aa61 (patch)
tree056ff84c72d16ad4233c733b864eeec8e742259c
parent6e1216e0f4a1728e53a50cdeb0085ba8552a4d50 (diff)
downloadmgamirrors-3f2d223640af766ef2fdeb37a7acf36af602aa61.tar
mgamirrors-3f2d223640af766ef2fdeb37a7acf36af602aa61.tar.gz
mgamirrors-3f2d223640af766ef2fdeb37a7acf36af602aa61.tar.bz2
mgamirrors-3f2d223640af766ef2fdeb37a7acf36af602aa61.tar.xz
mgamirrors-3f2d223640af766ef2fdeb37a7acf36af602aa61.zip
- fix mirror checking
-rw-r--r--lib/MGA/Mirrors/DB.pm11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/MGA/Mirrors/DB.pm b/lib/MGA/Mirrors/DB.pm
index a7655b8..80005a3 100644
--- a/lib/MGA/Mirrors/DB.pm
+++ b/lib/MGA/Mirrors/DB.pm
@@ -218,7 +218,6 @@ sub check_distributions {
my $listd = $self->db->prepare(q{
select * from toplevel_urls, distributions
- where toplevel_urls.valid = true
});
my $addstatus = $self->db->prepare(q{
@@ -257,11 +256,13 @@ sub check_distributions {
$upd_url_lastok->execute($res->{key}) if ($ok);
$urls_status{$res->{key}} = $ok;
}
- $urls_status{$res->{key}} or next;
- my $furi = URI->new(join('/', $url, $res->{relpath}, $res->{relfile}));
- my $exists = $self->_check_url($furi);
+ my $exists;
+ if ($urls_status{$res->{key}}) {
+ my $furi = URI->new(join('/', $url, $res->{relpath}, $res->{relfile}));
+ $exists = $self->_check_url($furi);
+ }
if ($updstatus->execute($exists ? 1 : 0, $res->{key}, $res->{dkey}) == 0) {
- $addstatus->execute($res->{key}, $res->{dkey}, $exists);
+ $addstatus->execute($res->{key}, $res->{dkey}, $exists ? 1 : 0);
}
$upd_lastok->execute($res->{key}, $res->{dkey}) if ($exists);
$self->db->commit;