summaryrefslogtreecommitdiffstats
path: root/web/html
diff options
context:
space:
mode:
authorCallan Barrett <wizzomafizzo@gmail.com>2008-06-08 16:02:42 +0200
committerCallan Barrett <wizzomafizzo@gmail.com>2008-06-09 13:51:25 +0200
commit63d70dc84ae3cc107b14b2871d89185dd44857e6 (patch)
treea2f4252493cd00768462b5eeeb03d74a251019cd /web/html
parentb2435996ddf6d5e92b15f7c950d7877eb6e1c15a (diff)
downloadaur-63d70dc84ae3cc107b14b2871d89185dd44857e6.tar.gz
aur-63d70dc84ae3cc107b14b2871d89185dd44857e6.tar.xz
Fix FS#8622
Previous fix for this was only half implemented, links now work with both a new package and an updated one Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
Diffstat (limited to 'web/html')
-rw-r--r--web/html/pkgsubmit.php42
1 files changed, 24 insertions, 18 deletions
diff --git a/web/html/pkgsubmit.php b/web/html/pkgsubmit.php
index 38e8cca6..00ac8617 100644
--- a/web/html/pkgsubmit.php
+++ b/web/html/pkgsubmit.php
@@ -396,22 +396,22 @@ if ($_COOKIE["AURSID"]) {
#
$depends = explode(" ", $new_pkgbuild['depends']);
- while (list($k, $v) = each($depends)) {
+ while (list($k, $v) = each($depends)) {
$q = "INSERT INTO PackageDepends (PackageID, DepPkgID, DepCondition) VALUES (";
$deppkgname = preg_replace("/[<>]?=.*/", "", $v);
- $depcondition = str_replace($deppkgname, "", $v);
+ $depcondition = str_replace($deppkgname, "", $v);
- # Solve the problem with comments and deps
- # added by: dsa <dsandrade@gmail.com>
- if ($deppkgname == "#")
- break;
+ # Solve the problem with comments and deps
+ # added by: dsa <dsandrade@gmail.com>
+ if ($deppkgname == "#") { break; }
$deppkgid = create_dummy($deppkgname, $_COOKIE['AURSID']);
- if(!empty($depcondition))
- $q .= $pdata["ID"].", ".$deppkgid.", '".$depcondition."')";
- else
- $q .= $pdata["ID"].", ".$deppkgid.", '')";
+ if(!empty($depcondition)) {
+ $q .= $pdata["ID"].", ".$deppkgid.", '".$depcondition."')";
+ } else {
+ $q .= $pdata["ID"].", ".$deppkgid.", '')";
+ }
db_query($q, $dbh);
}
@@ -469,16 +469,22 @@ if ($_COOKIE["AURSID"]) {
#
$depends = explode(" ", $new_pkgbuild['depends']);
while (list($k, $v) = each($depends)) {
- $q = "INSERT INTO PackageDepends (PackageID, DepPkgID) VALUES (";
+ $q = "INSERT INTO PackageDepends (PackageID, DepPkgID, DepCondition) VALUES (";
$deppkgname = preg_replace("/[<>]?=.*/", "", $v);
+ $depcondition = str_replace($deppkgname, "", $v);
- # Solve the problem with comments and deps
- # added by: dsa <dsandrade@gmail.com>
- if ($deppkgname == "#")
- break;
-
- $deppkgid = create_dummy($deppkgname, $_COOKIE['AURSID']);
- $q .= $packageID.", ".$deppkgid.")";
+ # Solve the problem with comments and deps
+ # added by: dsa <dsandrade@gmail.com>
+ if ($deppkgname == "#") { break; }
+
+ $deppkgid = create_dummy($deppkgname, $_COOKIE['AURSID']);
+
+ if(!empty($depcondition)) {
+ $q .= $packageID.", ".$deppkgid.", '".$depcondition."')";
+ } else {
+ $q .= $packageID.", ".$deppkgid.", '')";
+ }
+
db_query($q, $dbh);
}