diff options
| author | Dan Fandrich <danf@mageia.org> | 2025-11-14 09:56:39 -0800 |
|---|---|---|
| committer | Dan Fandrich <danf@mageia.org> | 2025-11-14 09:56:39 -0800 |
| commit | 9e627ebec6f7747da04e40bca57fe0c145fad00c (patch) | |
| tree | ded140190f7856bfb75af80d32a6bf563642e3d7 /lib/MGA | |
| parent | cf3228c6e24dfbf7531312afd2e4219b1928aa21 (diff) | |
| download | mgamirrors-9e627ebec6f7747da04e40bca57fe0c145fad00c.tar mgamirrors-9e627ebec6f7747da04e40bca57fe0c145fad00c.tar.gz mgamirrors-9e627ebec6f7747da04e40bca57fe0c145fad00c.tar.bz2 mgamirrors-9e627ebec6f7747da04e40bca57fe0c145fad00c.tar.xz mgamirrors-9e627ebec6f7747da04e40bca57fe0c145fad00c.zip | |
Don't bother writing to disk in _check_url()
The actual data doesn't matter, so just send to /dev/null or avoid
downloading it altogether.
Diffstat (limited to 'lib/MGA')
| -rw-r--r-- | lib/MGA/Mirrors/DB.pm | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/MGA/Mirrors/DB.pm b/lib/MGA/Mirrors/DB.pm index 6815eba..1f59614 100644 --- a/lib/MGA/Mirrors/DB.pm +++ b/lib/MGA/Mirrors/DB.pm @@ -286,13 +286,10 @@ sub check_distributions { sub _check_url { my ($self, $furi) = @_; - my ($fh, $filename) = tempfile(); - close($fh); my $cmd = - $furi->scheme =~ /^http|ftp$/ ? "wget -q --no-check-certificate -nv -t 1 -T $timeout -O $filename " . $furi->as_string : - $furi->scheme eq 'rsync' ? "rsync --timeout $timeout -q " . $furi->as_string . " $filename 2>/dev/null" : ''; + $furi->scheme =~ /^http|ftp$/ ? "wget -q --no-check-certificate -nv -t 1 -T $timeout -O /dev/null " . $furi->as_string : + $furi->scheme eq 'rsync' ? "rsync --dry-run --timeout $timeout -q " . $furi->as_string . " /dev/null 2>/dev/null" : ''; my $ok = (system($cmd) == 0); - unlink($filename); #print STDERR "Result of \"$cmd\" was " . ($ok ? "ok" : "failure") . "\n"; return $ok } |
