Commit 5b01327f authored by Gergely Imreh's avatar Gergely Imreh Committed by Loui Chang
Browse files

Fix: FS#12698 - AUR does not ignore comment lines in PKGBUILD source field.



The web interface was handling comments in the PKGBUILD variable fields
(such as 'source','depends',etc...) differently from makepkg, because
makepkg ignores the rest of the current line if there is a # character,
while the web interface parsed that as well, and listed the words of the
comment as source files.

Signed-off-by: default avatarLoui Chang <louipc.ist@gmail.com>
parent 2da9b55d
......@@ -73,6 +73,7 @@ if ($_COOKIE["AURSID"]):
$fp = fopen($pkg_dir."/PKGBUILD", "r");
$line_no = 0;
$lines = array();
$decomment = array();
$continuation_line = 0;
$current_line = "";
$paren_depth = 0;
......@@ -89,6 +90,8 @@ if ($_COOKIE["AURSID"]):
# assumed continuation
# continue appending onto existing line_no
#
$decomment = explode("#",$line,2);
$line = $decomment[0];
$current_line .= $line . " ";
$continuation_line = 1;
} else {
......@@ -331,9 +334,11 @@ if ($_COOKIE["AURSID"]):
# Insert sources
$sources = explode(" ", $new_pkgbuild['source']);
foreach ($sources as $src) {
$q = "INSERT INTO PackageSources (PackageID, Source) VALUES (";
$q .= $pdata["ID"] . ", '" . mysql_real_escape_string($src) . "')";
db_query($q, $dbh);
if ($src != "" ) {
$q = "INSERT INTO PackageSources (PackageID, Source) VALUES (";
$q .= $pdata["ID"] . ", '" . mysql_real_escape_string($src) . "')";
db_query($q, $dbh);
}
}
header('Location: packages.php?ID=' . $pdata['ID']);
......@@ -377,9 +382,11 @@ if ($_COOKIE["AURSID"]):
# Insert sources
$sources = explode(" ", $new_pkgbuild['source']);
foreach ($sources as $src) {
$q = "INSERT INTO PackageSources (PackageID, Source) VALUES (";
$q .= $packageID . ", '" . mysql_real_escape_string($src) . "')";
db_query($q, $dbh);
if ($src != "" ) {
$q = "INSERT INTO PackageSources (PackageID, Source) VALUES (";
$q .= $packageID . ", '" . mysql_real_escape_string($src) . "')";
db_query($q, $dbh);
}
}
header('Location: packages.php?ID=' . $packageID);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment