mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
parsed the PKGBUILD, time to add the data to the db
This commit is contained in:
parent
5abb4b8b77
commit
cb820450f8
1 changed files with 8 additions and 3 deletions
|
@ -160,7 +160,7 @@ if ($_COOKIE["AURSID"]) {
|
||||||
$lines = array();
|
$lines = array();
|
||||||
$continuation_line = 0;
|
$continuation_line = 0;
|
||||||
$current_line = "";
|
$current_line = "";
|
||||||
while (!$feof($fp)) {
|
while (!feof($fp)) {
|
||||||
$line = trim(fgets($fp));
|
$line = trim(fgets($fp));
|
||||||
if (substr($line, strlen($line)-1) == "\\") {
|
if (substr($line, strlen($line)-1) == "\\") {
|
||||||
# continue appending onto existing line_no
|
# continue appending onto existing line_no
|
||||||
|
@ -192,9 +192,10 @@ if ($_COOKIE["AURSID"]) {
|
||||||
|
|
||||||
$lparts = explode("=", $line);
|
$lparts = explode("=", $line);
|
||||||
if (count($lparts) == 2) {
|
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 {
|
} else {
|
||||||
# either a comment, blank line, continued line, or build function
|
# either a comment, blank line, continued line, or build function
|
||||||
#
|
#
|
||||||
|
@ -232,6 +233,10 @@ if ($_COOKIE["AURSID"]) {
|
||||||
}
|
}
|
||||||
if (!array_key_exists("pkgname", $pkgbuild)) {
|
if (!array_key_exists("pkgname", $pkgbuild)) {
|
||||||
$error = __("Missing pkgname variable in PKGBUILD.");
|
$error = __("Missing pkgname variable in PKGBUILD.");
|
||||||
|
} else {
|
||||||
|
if ($pkgbuild["pkgname"] != $pkg_name) {
|
||||||
|
$error = __("Package names do not match.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue