summaryrefslogtreecommitdiffstats
path: root/web/html/pkgsubmit.php
diff options
context:
space:
mode:
authorLukas Fleischer <archlinux@cryptocrack.de>2014-04-26 14:07:20 +0200
committerLukas Fleischer <archlinux@cryptocrack.de>2014-04-26 14:07:20 +0200
commitcc3244ea8ae0202265df3d0fd2cfe86fbbeb9d30 (patch)
treeacdf3629538c57886b41f9216bb4e132939d7452 /web/html/pkgsubmit.php
parent3720bdf6b264cb4bb603e4199f2758598c260ed4 (diff)
downloadaur-cc3244ea8ae0202265df3d0fd2cfe86fbbeb9d30.tar.gz
aur-cc3244ea8ae0202265df3d0fd2cfe86fbbeb9d30.tar.xz
Store package groups in the database
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Diffstat (limited to 'web/html/pkgsubmit.php')
-rw-r--r--web/html/pkgsubmit.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/web/html/pkgsubmit.php b/web/html/pkgsubmit.php
index 3df38d82..107441ff 100644
--- a/web/html/pkgsubmit.php
+++ b/web/html/pkgsubmit.php
@@ -151,6 +151,7 @@ if ($uid):
}
}
$section_info = array(
+ 'groups' => array(),
'depends' => array(),
'makedepends' => array(),
'checkdepends' => array(),
@@ -169,6 +170,7 @@ if ($uid):
case 'license':
$section_info[$key] = $value;
break;
+ case 'groups':
case 'source':
case 'depends':
case 'makedepends':
@@ -196,7 +198,7 @@ if ($uid):
if (!isset($pkgbase_info['pkgbase'])) {
$pkgbase_info['pkgbase'] = $pkgbase_info['pkgname'];
}
- foreach (array('source', 'depends', 'makedepends', 'checkdepends', 'optdepends', 'conflicts', 'provides', 'replaces') as $array_opt) {
+ foreach (array('groups', 'source', 'depends', 'makedepends', 'checkdepends', 'optdepends', 'conflicts', 'provides', 'replaces') as $array_opt) {
if (empty($pkgbase_info[$array_opt])) {
$pkgbase_info[$array_opt] = array();
} else {
@@ -357,6 +359,11 @@ if ($uid):
foreach ($pkginfo as $pi) {
$pkgid = pkg_create($base_id, $pi['pkgname'], $pi['license'], $pi['full-version'], $pi['pkgdesc'], $pi['url']);
+ foreach ($pi['groups'] as $grp) {
+ $grpid = pkg_create_group($grp);
+ pkg_add_grp($pkgid, $grpid);
+ }
+
foreach (array('depends', 'makedepends', 'checkdepends', 'optdepends') as $deptype) {
foreach ($pi[$deptype] as $dep) {
$deppkgname = preg_replace("/(<|=|>).*/", "", $dep);