[aur-dev] [PATCH] don't treat colon as part of package dependency name
Dependencies can have a description appended, separated by a colon. Don't treat this colon as part of the dependency name. Signed-off-by: Daniel Albers <daniel@lbe.rs> --- web/html/pkgsubmit.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/html/pkgsubmit.php b/web/html/pkgsubmit.php index d2fe512..305acc7 100644 --- a/web/html/pkgsubmit.php +++ b/web/html/pkgsubmit.php @@ -421,7 +421,7 @@ if ($uid): } if (!empty($depends)) { foreach ($depends as $dep) { - $deppkgname = preg_replace("/(<|<=|=|>=|>).*/", "", $dep); + $deppkgname = preg_replace("/(<|<=|=|>=|>|:).*/", "", $dep); $depcondition = str_replace($deppkgname, "", $dep); if ($deppkgname == "") { -- 1.8.4.2
On Mon, Nov 25, 2013 at 7:14 AM, Daniel Albers <daniel@lbe.rs> wrote:
Dependencies can have a description appended, separated by a colon. Don't treat this colon as part of the dependency name.
I know that optdepends often have the dependency name followed by a colon and a description of the package. I don't recall ever seeing a package description within the depends array...
Signed-off-by: Daniel Albers <daniel@lbe.rs> --- web/html/pkgsubmit.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/web/html/pkgsubmit.php b/web/html/pkgsubmit.php index d2fe512..305acc7 100644 --- a/web/html/pkgsubmit.php +++ b/web/html/pkgsubmit.php @@ -421,7 +421,7 @@ if ($uid): } if (!empty($depends)) { foreach ($depends as $dep) { - $deppkgname = preg_replace("/(<|<=|=|>=|>).*/", "", $dep); + $deppkgname = preg_replace("/(<|<=|=|>=|>|:).*/", "", $dep); $depcondition = str_replace($deppkgname, "", $dep);
if ($deppkgname == "") { -- 1.8.4.2
On 26.11.2013 01:19, canyonknight wrote:
On Mon, Nov 25, 2013 at 7:14 AM, Daniel Albers <daniel@lbe.rs> wrote:
Dependencies can have a description appended, separated by a colon. Don't treat this colon as part of the dependency name.
I know that optdepends often have the dependency name followed by a colon and a description of the package. I don't recall ever seeing a package description within the depends array...
So, what does that mean? If it's valid PKGBUILD syntax, AUR should be able to parse it correctly IMHO. Otherwise it should treat it as error. Instead it just uses "dep:" as the dependency name at the moment.
On Tue, 26 Nov 2013 at 11:53:31, Daniel Albers wrote:
On 26.11.2013 01:19, canyonknight wrote:
On Mon, Nov 25, 2013 at 7:14 AM, Daniel Albers <daniel@lbe.rs> wrote:
Dependencies can have a description appended, separated by a colon. Don't treat this colon as part of the dependency name.
I know that optdepends often have the dependency name followed by a colon and a description of the package. I don't recall ever seeing a package description within the depends array...
So, what does that mean? If it's valid PKGBUILD syntax, AUR should be able to parse it correctly IMHO. Otherwise it should treat it as error. Instead it just uses "dep:" as the dependency name at the moment.
The AUR does not (and never will) include a full PKGBUILD parser. This has been discussed several times, see e.g. FS#15043 [1]. I am tempted to add code to filter out common errors (like split packages, for example), but in this case I doubt that a lot of people do include colons in dependencies and disallowing them might also result in valid PKGBUILD being rejected (think of versioned dependencies with epoch, think of bash substitutions). Regards, Lukas [1] https://bugs.archlinux.org/task/15043
participants (3)
-
canyonknight
-
Daniel Albers
-
Lukas Fleischer