| 443 |
function dl_popcon() { |
function dl_popcon() { |
| 444 |
global $dirs,$dbconn; |
global $dirs,$dbconn; |
| 445 |
|
|
| 446 |
$localtempfile=$dirs[popcon_dir] . "/popcon.db.new"; |
$localtempdir=$dirs[popcon_dir] . "/new"; |
| 447 |
|
dir_ctrl($localtempdir); |
| 448 |
|
|
| 449 |
$localfile=$dirs[popcon_dir] . "/popcon.db"; |
$localfile=$dirs[popcon_dir] . "/popcon.db"; |
| 450 |
$remotefile='http://qa.debian.org/data/popcon/popcon.db'; |
$remotefile='http://qa.debian.org/data/popcon/popcon.db'; |
| 451 |
|
|
| 452 |
$return = 0; |
$return = 0; |
| 453 |
$output = null; |
$output = null; |
| 454 |
exec('/usr/bin/wget -qNc -O'.escapeshellarg($localtempfile).' ' . escapeshellarg($remotefile), $output, $return); |
exec('cd ' . escapeshellarg($localtempdir) . ' && ' . |
| 455 |
|
'/usr/bin/wget -qNc ' . escapeshellarg($remotefile), $output, $return); |
| 456 |
|
|
| 457 |
if ($return != 0) { |
if ($return != 0) { |
| 458 |
echo __FUNCTION__ . "wget exited with status $return!\n"; |
echo __FUNCTION__ . "wget exited with status $return!\n"; |
| 459 |
return false; |
return false; |
| 460 |
} |
} |
| 461 |
|
|
| 462 |
return copy($localtempfile, $localfile); |
return copy($localtempdir . '/popcon.db', $localfile); |
| 463 |
} |
} |
| 464 |
function is_updated ($up_vers,$debian_vers, $dversionAsIs = false) { |
function is_updated ($up_vers,$debian_vers, $dversionAsIs = false) { |
| 465 |
if ($up_vers=='') return 1; |
if ($up_vers=='') return 1; |