Add full support for the new .AURINFO format

This adds full support for the new .AURINFO format used by mkaurball,
including support for split packages.

The old PKGBUILD parser is still available for compatibility reasons.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
This commit is contained in:
Lukas Fleischer 2014-04-05 01:22:04 +02:00
parent b558572a2e
commit fb81bfd8df
2 changed files with 181 additions and 117 deletions

View file

@ -815,6 +815,33 @@ function pkgbase_name_from_id($base_id) {
return $result->fetch(PDO::FETCH_COLUMN, 0);
}
/**
* Delete all packages belonging to a package base
*
* @param int $base_id The ID of the package base
*
* @return void
*/
function pkgbase_delete_packages($base_id) {
$dbh = DB::connect();
$q = "DELETE FROM Packages WHERE PackageBaseID = " . intval($base_id);
$dbh->exec($q);
}
/**
* Retrieve the maintainer of a package base given its ID
*
* @param int $base_id The ID of the package base to query
*
* @return int The user ID of the current package maintainer
*/
function pkgbase_maintainer_uid($base_id) {
$dbh = DB::connect();
$q = "SELECT MaintainerUID FROM PackageBases WHERE ID = " . intval($base_id);
$result = $dbh->query($q);
return $result->fetch(PDO::FETCH_COLUMN, 0);
}
/**
* Flag package(s) as out-of-date