update_versions: handle files that are both gzipped and replicated

This commit is contained in:
David Anderson 2014-09-17 10:30:48 -07:00
parent 562edbed3f
commit 4850d0236c
1 changed files with 5 additions and 4 deletions

View File

@ -89,6 +89,7 @@ function file_info_xml($fd) {
if (is_array($fd->url)) {
foreach ($fd->url as $url) {
$xml .= " <url>$url</url>\n";
$xml .= " <gzipped_url>$url.gz</gzipped_url>\n";
}
} else {
$xml .= " <url>$fd->url</url>\n";
@ -170,7 +171,9 @@ function stage_file($a, $v, $p, $fd) {
system("cp $path $dl_path");
}
if (!sizeof($fd->url)) {
$fd->url = "$download_url/$name";
}
if ($fd->gzip) {
if (!file_exists("$dl_path.gz")) {
$tmp = "$dl_path.tmp";
@ -256,9 +259,7 @@ function process_file($a, $v, $p, $name, $fds) {
}
}
if (!sizeof($fd->url)) {
$fd = stage_file($a, $v, $p, $fd);
}
if (!isset($fd->executable)) {
$perms = fileperms($path);