summaryrefslogtreecommitdiffstats
path: root/web/lib/pkgfuncs.inc.php
diff options
context:
space:
mode:
authorLukas Fleischer <archlinux@cryptocrack.de>2014-04-05 01:22:04 +0200
committerLukas Fleischer <archlinux@cryptocrack.de>2014-04-05 12:21:36 +0200
commitfb81bfd8dff66073de6704c1880fb921e58ef137 (patch)
tree95ce6801647a4b9cbdcae41ec3adaedd0c217a82 /web/lib/pkgfuncs.inc.php
parentb558572a2ee6c1022eb1e663840f11a5745459a9 (diff)
downloadaurweb-fb81bfd8dff66073de6704c1880fb921e58ef137.tar.xz
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>
Diffstat (limited to 'web/lib/pkgfuncs.inc.php')
-rw-r--r--web/lib/pkgfuncs.inc.php27
1 files changed, 27 insertions, 0 deletions
diff --git a/web/lib/pkgfuncs.inc.php b/web/lib/pkgfuncs.inc.php
index ef0eba9..3ef069c 100644
--- a/web/lib/pkgfuncs.inc.php
+++ b/web/lib/pkgfuncs.inc.php
@@ -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