summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
Diffstat (limited to 'web')
-rw-r--r--web/html/pkgsubmit.php16
-rw-r--r--web/lib/pkgfuncs.inc9
2 files changed, 18 insertions, 7 deletions
diff --git a/web/html/pkgsubmit.php b/web/html/pkgsubmit.php
index 52e23aad..9d54271e 100644
--- a/web/html/pkgsubmit.php
+++ b/web/html/pkgsubmit.php
@@ -87,7 +87,8 @@ if ($_COOKIE["AURSID"]) {
#
$upload_file = $UPLOAD_DIR . $pkg_name;
- if (move_uploaded_file($_FILES["pfile"]["tmp_name"], $upload_file)) {
+
+ if (move_uploaded_file($_FILES["pfile"]["tmp_name"], $upload_file)) {
# ok, we can proceed
#
if (file_exists($INCOMING_DIR . $pkg_name)) {
@@ -427,9 +428,11 @@ if ($_COOKIE["AURSID"]) {
# update package depends
#
$depends = explode(" ", $new_pkgbuild['depends']);
- while (list($k, $v) = each($depends)) {
- $q = "INSERT INTO PackageDepends (PackageID, DepPkgID) VALUES (";
+
+ while (list($k, $v) = each($depends)) {
+ $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>
@@ -437,7 +440,12 @@ if ($_COOKIE["AURSID"]) {
break;
$deppkgid = create_dummy($deppkgname, $_COOKIE['AURSID']);
- $q .= $pdata["ID"].", ".$deppkgid.")";
+
+ if(!empty($depcondition))
+ $q .= $pdata["ID"].", ".$deppkgid.", '".$depcondition."')";
+ else
+ $q .= $pdata["ID"].", ".$deppkgid.", '')";
+
db_query($q, $dbh);
}
diff --git a/web/lib/pkgfuncs.inc b/web/lib/pkgfuncs.inc
index daeb8f13..d7d13727 100644
--- a/web/lib/pkgfuncs.inc
+++ b/web/lib/pkgfuncs.inc
@@ -139,7 +139,7 @@ function package_dependencies($pkgid=0) {
$deps = array();
if ($pkgid) {
$dbh = db_connect();
- $q = "SELECT DepPkgID, Name, DummyPkg FROM PackageDepends, Packages ";
+ $q = "SELECT DepPkgID, Name, DummyPkg, DepCondition FROM PackageDepends, Packages ";
$q.= "WHERE PackageDepends.DepPkgID = Packages.ID ";
$q.= "AND PackageDepends.PackageID = ".mysql_escape_string($pkgid);
$q.= " ORDER BY Name";
@@ -402,8 +402,11 @@ function package_details($id=0, $SID="") {
}
}
reset($pkgsearch_vars);
- if ($darr[2] == 0) print $url."'>".$darr[1]."</a><br />\n";
- else print "<a href='#'>".$darr[1]."</a><br />\n";
+
+ // $darr[3] is the DepCondition
+
+ if ($darr[2] == 0) print $url."'>".$darr[1].$darr[3]."</a><br />\n";
+ else print "<a href='#'>".$darr[1].$darr[3]."</a><br />\n";
}
print "</td></tr>\n";
print "</table></td>";