diff options
author | jchu <jchu> | 2004-12-14 23:08:07 +0000 |
---|---|---|
committer | jchu <jchu> | 2004-12-14 23:08:07 +0000 |
commit | 341d17b5a156386dac56b2235ce8acf237333630 (patch) | |
tree | 617a8d8d882f48a3e8bd01bb89c8d4fd9c48b05a /web | |
parent | ad8f4991476870d9ddeacdf72f4dd633570c8ec7 (diff) | |
download | aurweb-341d17b5a156386dac56b2235ce8acf237333630.tar.xz |
added code to handle assumed line continuations and cases
Diffstat (limited to 'web')
-rw-r--r-- | web/html/pkgsubmit.php | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/web/html/pkgsubmit.php b/web/html/pkgsubmit.php index 1b986cc..f22fe67 100644 --- a/web/html/pkgsubmit.php +++ b/web/html/pkgsubmit.php @@ -188,11 +188,18 @@ if ($_COOKIE["AURSID"]) { $current_line = ""; while (!feof($fp)) { $line = trim(fgets($fp)); + $char_counts = count_chars($line, 0); if (substr($line, strlen($line)-1) == "\\") { # continue appending onto existing line_no # $current_line .= substr($line, 0, strlen($line)-1); $continuation_line = 1; + } elseif ($char_counts[ord('(')] > $char_counts[ord(')')]) { + # assumed continuation + # continue appending onto existing line_no + # + $current_line .= $line . " "; + $continuation_line = 1; } else { # maybe the last line in a continuation, or a standalone line? # @@ -219,7 +226,6 @@ if ($_COOKIE["AURSID"]) { # $seen_build_function = 0; while (list($k, $line) = each($lines)) { - $lparts = explode("=", $line); if (count($lparts) == 2) { # this is a variable/value pair, strip out @@ -286,7 +292,9 @@ if ($_COOKIE["AURSID"]) { $new_pkgbuild = array(); while (list($k, $v) = each($pkgbuild)) { $v = str_replace("\$pkgname", $pkgname_var, $v); + $v = str_replace("\${pkgname}", $pkgname_var, $v); $v = str_replace("\$pkgver", $pkgver_var, $v); + $v = str_replace("\${pkgver}", $pkgver_var, $v); $new_pkgbuild[$k] = $v; } } |