summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authoreric <eric>2004-09-16 17:06:45 +0000
committereric <eric>2004-09-16 17:06:45 +0000
commitcb820450f89ea0c55c96a9a43e3a5a921bbdf765 (patch)
treedd75d9f17b8c6151130468ad9ad7f037f52f79d7 /web
parent5abb4b8b77ae1042f3c869bdd6452066f833b66d (diff)
downloadaurweb-cb820450f89ea0c55c96a9a43e3a5a921bbdf765.tar.xz
parsed the PKGBUILD, time to add the data to the db
Diffstat (limited to 'web')
-rw-r--r--web/html/pkgsubmit.php11
1 files 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.");
+ }
}
}