diff options
author | dsa <dsa> | 2006-10-13 03:55:58 +0000 |
---|---|---|
committer | dsa <dsa> | 2006-10-13 03:55:58 +0000 |
commit | e17a4ceb6ad00bcb51e49d39e5d1a9cd6129352b (patch) | |
tree | b07210aa043844bdd42a0c563838234dce4ce13c /web/html | |
parent | 48a07d401025b55aa1e5b710c7b299bbfd853a0a (diff) | |
download | aurweb-e17a4ceb6ad00bcb51e49d39e5d1a9cd6129352b.tar.xz |
Solved the #3939 bug and it will require a change in the PackageDepends table to add a DepCondition field with the type varchar(20).
Diffstat (limited to 'web/html')
-rw-r--r-- | web/html/pkgsubmit.php | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/web/html/pkgsubmit.php b/web/html/pkgsubmit.php index 52e23aa..9d54271 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); } |