summaryrefslogtreecommitdiffstats
path: root/web/html/pkgsubmit.php
diff options
context:
space:
mode:
Diffstat (limited to 'web/html/pkgsubmit.php')
-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 38e8cca..00ac861 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);
}