diff options
author | Lukas Fleischer <archlinux@cryptocrack.de> | 2014-04-17 19:49:26 +0200 |
---|---|---|
committer | Lukas Fleischer <archlinux@cryptocrack.de> | 2014-04-17 21:09:16 +0200 |
commit | 73936002f7d5685a9063683f68d4e8c2e01be0ac (patch) | |
tree | c1f152f76be0399222a47cab2060998e41ce5688 /web/html | |
parent | 32b5d466439b5c291472c68f6a732c5be4ca60cf (diff) | |
download | aur-73936002f7d5685a9063683f68d4e8c2e01be0ac.tar.gz aur-73936002f7d5685a9063683f68d4e8c2e01be0ac.tar.xz |
Store {make,check,opt}depends in the database
In addition to parsing and storing dependencies of packages, store
makedepends, checkdepends and optdepends. Every dependency (of any type)
is displayed on the package details page.
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Diffstat (limited to 'web/html')
-rw-r--r-- | web/html/pkgsubmit.php | 36 |
1 files changed, 22 insertions, 14 deletions
diff --git a/web/html/pkgsubmit.php b/web/html/pkgsubmit.php index 7db81a5c..045b8f93 100644 --- a/web/html/pkgsubmit.php +++ b/web/html/pkgsubmit.php @@ -150,7 +150,13 @@ if ($uid): $pkginfo[] = array_merge($pkgbase_info, $section_info); } } - $section_info = array('depends' => array(), 'source' => array()); + $section_info = array( + 'depends' => array(), + 'makedepends' => array(), + 'checkdepends' => array(), + 'optdepends' => array(), + 'source' => array() + ); /* Fall-through case. */ case 'epoch': case 'pkgdesc': @@ -162,6 +168,9 @@ if ($uid): break; case 'source': case 'depends': + case 'makedepends': + case 'checkdepends': + case 'optdepends': $section_info[$key][] = $value; break; } @@ -181,15 +190,12 @@ if ($uid): if (!isset($pkgbase_info['pkgbase'])) { $pkgbase_info['pkgbase'] = $pkgbase_info['pkgname']; } - if (empty($pkgbase_info['depends'])) { - $pkgbase_info['depends'] = array(); - } else { - $pkgbase_info['depends'] = explode(" ", $pkgbase_info['depends']); - } - if (empty($pkgbase_info['source'])) { - $pkgbase_info['source'] = array(); - } else { - $pkgbase_info['source'] = explode(" ", $pkgbase_info['source']); + foreach (array('source', 'depends', 'makedepends', 'checkdepends', 'optdepends') as $array_opt) { + if (empty($pkgbase_info[$array_opt])) { + $pkgbase_info[$array_opt] = array(); + } else { + $pkgbase_info[$array_opt] = explode(" ", $pkgbase_info[$array_opt]); + } } $pkginfo[] = $pkgbase_info; } @@ -345,10 +351,12 @@ if ($uid): foreach ($pkginfo as $pi) { $pkgid = pkg_create($base_id, $pi['pkgname'], $pi['license'], $pi['full-version'], $pi['pkgdesc'], $pi['url']); - foreach ($pi['depends'] as $dep) { - $deppkgname = preg_replace("/(<|=|>).*/", "", $dep); - $depcondition = str_replace($deppkgname, "", $dep); - pkg_add_dep($pkgid, $deppkgname, $depcondition); + foreach (array('depends', 'makedepends', 'checkdepends', 'optdepends') as $deptype) { + foreach ($pi[$deptype] as $dep) { + $deppkgname = preg_replace("/(<|=|>).*/", "", $dep); + $depcondition = str_replace($deppkgname, "", $dep); + pkg_add_dep($pkgid, $deptype, $deppkgname, $depcondition); + } } foreach ($pi['source'] as $src) { |