From cb820450f89ea0c55c96a9a43e3a5a921bbdf765 Mon Sep 17 00:00:00 2001 From: eric Date: Thu, 16 Sep 2004 17:06:45 +0000 Subject: parsed the PKGBUILD, time to add the data to the db --- web/html/pkgsubmit.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/web/html/pkgsubmit.php b/web/html/pkgsubmit.php index 936917b..a670421 100644 --- a/web/html/pkgsubmit.php +++ b/web/html/pkgsubmit.php @@ -160,7 +160,7 @@ if ($_COOKIE["AURSID"]) { $lines = array(); $continuation_line = 0; $current_line = ""; - while (!$feof($fp)) { + while (!feof($fp)) { $line = trim(fgets($fp)); if (substr($line, strlen($line)-1) == "\\") { # continue appending onto existing line_no @@ -192,9 +192,10 @@ if ($_COOKIE["AURSID"]) { $lparts = explode("=", $line); if (count($lparts) == 2) { - # this is a variable/value pair + # this is a variable/value pair, strip out + # array parens and any quoting # - $pkgbuild[$lparts[0]] = $lparts[1]; + $pkgbuild[$lparts[0]] = str_replace(array("(",")","\"","'"), "", $lparts[1]); } else { # either a comment, blank line, continued line, or build function # @@ -232,6 +233,10 @@ if ($_COOKIE["AURSID"]) { } if (!array_key_exists("pkgname", $pkgbuild)) { $error = __("Missing pkgname variable in PKGBUILD."); + } else { + if ($pkgbuild["pkgname"] != $pkg_name) { + $error = __("Package names do not match."); + } } } -- cgit v1.2.3-54-g00ecf