[PATCH 1/1] This patch implements FS#54906. Ability to query by pkgver via RPC or web request (url)

Nodiv Byzero nodivbyzero at gmail.com
Sun Jun 10 23:28:36 UTC 2018


Hey Lukas.

This patch implements additional check for package version. Of course,
all clients can search by the name and then compare the version
itself. But... this small improvement can help clients a lot. Here[1]
is the good example.

[1] https://github.com/falconindy/auracle/issues/3

On Sat, Jun 9, 2018 at 10:42 AM, Lukas Fleischer
<lfleischer at archlinux.org> wrote:
> On Fri, 08 Jun 2018 at 00:09:22, nodivbyzero wrote:
>> ---
>>  web/lib/aurjson.class.php | 5 +++++
>>  web/lib/pkgfuncs.inc.php  | 4 ++++
>>  2 files changed, 9 insertions(+)
>>
>
> I don't quite understand what this is trying to fix. Can't the client
> simply obtain the package without the package version and then compare
> the versions itself? Please elaborate.
>
>> diff --git a/web/lib/aurjson.class.php b/web/lib/aurjson.class.php
>> index c51e9c2..30ce63f 100644
>> --- a/web/lib/aurjson.class.php
>> +++ b/web/lib/aurjson.class.php
>> @@ -486,6 +486,11 @@ class AurJSON {
>>
>>                         if ($search_by === 'name') {
>>                                 $where_condition = "(Packages.Name LIKE $keyword_string)";
>> +                               if (isset($http_data['pkgver'])) {
>> +                                       $pkgver = $http_data['pkgver'];
>> +                                       $pkgver_string = $this->dbh->quote($pkgver . "%");
>
> Not sure how useful that would be. If we agree that this is something to
> be implemented, I would expect to have proper support for version
> comparisons as supported by pacman. When would be need to search by
> matching prefixes?
>
> Best regards.
> Lukas


More information about the aur-dev mailing list