24,6 → 24,8 |
class Core { |
|
function getSourceList($distro,$version,$repos,$dblink) { |
// TODO optimize this |
if(count($repos)==0) return; |
// Fetch settings |
$query =& $dblink->query("SELECT * FROM settings"); |
$settings = array(); |
33,9 → 35,18 |
// Fetch info about distribution |
$query =& $dblink->query("SELECT * FROM version v JOIN distribution d ON d.dist_id=v.dist_id JOIN dtype p ON d.disttype=p.type_id WHERE v.dist_id='$distro' AND v.version_id='$version'"); |
$query->fetchInto($infodist, DB_FETCHMODE_ASSOC); |
// Fetch repos |
// Fetch default repos if not defined |
if($repos[0]=="-1") { |
$querydrep =& $dblink->query("SELECT * FROM repository r JOIN ver2rep v ON r.rep_id=v.rep_id JOIN version v2 ON v.ver_id=v2.version_id WHERE r.defaultrep='1' AND v2.version_id='$version'"); |
$i=0; |
while ($querydrep->fetchInto($dreps,DB_FETCHMODE_ASSOC)) { |
$repos[$i] = $dreps["rep_id"]; |
$i++; |
} |
}; |
if(count($repos)==0) return; |
// Processing repos |
$porigid = -1; // Previous origin id |
|
for($i=0;$i<count($repos);$i++) { |
$id=$repos[$i]; |
// Fetch info about origin and scheme |
67,7 → 78,7 |
return $result; |
} |
|
// For backward compatibility for Modern and Telepathy interfaces. Current getRepList() crushed his. |
// For backward compatibility for Modern interface. Current getRepList() crushed his. |
function getRepListLegacy($distro,$version,$dblink) { |
$query =& $dblink->query("SELECT * FROM settings"); |
$settings = array(); |