summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorLoui Chang <louipc.ist@gmail.com>2009-03-03 17:21:08 +0100
committerLoui Chang <louipc.ist@gmail.com>2009-03-03 17:21:08 +0100
commitbbc05414cf6aa24faa364afb48119f802b50bda2 (patch)
treeab87fdb233447598684412b5f0ae828ae2f9cc5e /web
parent701186ad05955ce47216bdfd4a0c264bc8b0d803 (diff)
downloadaur-bbc05414cf6aa24faa364afb48119f802b50bda2.tar.gz
aur-bbc05414cf6aa24faa364afb48119f802b50bda2.tar.xz
Update cleanup script to remove non-unsupported files.
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
Diffstat (limited to 'web')
-rw-r--r--web/lib/pkgfuncs.inc15
1 files changed, 15 insertions, 0 deletions
diff --git a/web/lib/pkgfuncs.inc b/web/lib/pkgfuncs.inc
index b95f910d..9d7a0db7 100644
--- a/web/lib/pkgfuncs.inc
+++ b/web/lib/pkgfuncs.inc
@@ -84,6 +84,21 @@ function pkgLocations() {
return $locs;
}
+# Return the repository name for a particular package.
+function package_location($name="") {
+ if (!$name) {return NULL;}
+ $dbh = db_connect();
+ $q = "SELECT PackageLocations.Location FROM Packages ";
+ $q.= "LEFT JOIN PackageLocations ON ";
+ $q.= "Packages.LocationID = PackageLocations.ID ";
+ $q.= "WHERE Name = '".mysql_real_escape_string($name)."' ";
+ $q.= "AND DummyPkg = 0";
+ $result = db_query($q, $dbh);
+ if (!$result) {return NULL;}
+ $row = mysql_fetch_row($result);
+ return $row[0];
+}
+
# check to see if the package name exists
#
function package_exists($name="") {