diff options
author | Lukas Fleischer <archlinux@cryptocrack.de> | 2014-04-26 10:29:17 +0200 |
---|---|---|
committer | Lukas Fleischer <archlinux@cryptocrack.de> | 2014-04-26 13:20:56 +0200 |
commit | 92812050a059a651357f772b58e967154ea8428c (patch) | |
tree | c7b61560011b3cbe0671c998b4ee0ce19fc40b22 /web/html/pkgsubmit.php | |
parent | 34453d32958cc71cf08e932368952f98b46b7020 (diff) | |
download | aur-92812050a059a651357f772b58e967154ea8428c.tar.gz aur-92812050a059a651357f772b58e967154ea8428c.tar.xz |
Store conflicts, provides and replaces in the DB
Package conflicts, provides and replaces are now stored in the new
PackageRelations table. The gendummydata script generates test entries
for these relations.
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Diffstat (limited to 'web/html/pkgsubmit.php')
-rw-r--r-- | web/html/pkgsubmit.php | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/web/html/pkgsubmit.php b/web/html/pkgsubmit.php index 11206e1f..3df38d82 100644 --- a/web/html/pkgsubmit.php +++ b/web/html/pkgsubmit.php @@ -155,7 +155,10 @@ if ($uid): 'makedepends' => array(), 'checkdepends' => array(), 'optdepends' => array(), - 'source' => array() + 'source' => array(), + 'conflicts' => array(), + 'provides' => array(), + 'replaces' => array() ); /* Fall-through case. */ case 'epoch': @@ -171,6 +174,9 @@ if ($uid): case 'makedepends': case 'checkdepends': case 'optdepends': + case 'conflicts': + case 'provides': + case 'replaces': $section_info[$key][] = $value; break; } @@ -190,7 +196,7 @@ if ($uid): if (!isset($pkgbase_info['pkgbase'])) { $pkgbase_info['pkgbase'] = $pkgbase_info['pkgname']; } - foreach (array('source', 'depends', 'makedepends', 'checkdepends', 'optdepends') as $array_opt) { + foreach (array('source', 'depends', 'makedepends', 'checkdepends', 'optdepends', 'conflicts', 'provides', 'replaces') as $array_opt) { if (empty($pkgbase_info[$array_opt])) { $pkgbase_info[$array_opt] = array(); } else { @@ -359,6 +365,14 @@ if ($uid): } } + foreach (array('conflicts', 'provides', 'replaces') as $reltype) { + foreach ($pi[$reltype] as $rel) { + $relpkgname = preg_replace("/(<|=|>).*/", "", $rel); + $relcondition = str_replace($relpkgname, "", $rel); + pkg_add_rel($pkgid, $reltype, $relpkgname, $relcondition); + } + } + foreach ($pi['source'] as $src) { pkg_add_src($pkgid, $src); } |