[devel] [PATCH] Verbose QueryTags prints whether tag is an extension

Andrey Savchenko bircoph на altlinux.org
Сб Апр 11 13:46:55 MSK 2020


On Sat, 11 Apr 2020 02:19:17 +0300 Vladimir D. Seleznev wrote:
> Verbose QueryTags prints four field: tagname, tagvalue, tagtype and whether
> it is an extension. To make it possible QueryTags uses new function
> rpmTagIsExtension() that return 0 if tag is real, 1 if tag is an extension
> or 2 if tag is not found.
[...]
> diff --git a/lib/rpmtag.h b/lib/rpmtag.h
> index f74b451dc..8e860f927 100644
> --- a/lib/rpmtag.h
> +++ b/lib/rpmtag.h
> @@ -519,6 +519,13 @@ rpmTagType rpmTagGetTagType(rpmTagVal tag);
>   */
>  rpmTagReturnType rpmTagGetReturnType(rpmTagVal tag);
>  
> +/** \ingroup rpmtag
> + * Return 0 if tag is real, 1 if tag is an extension, 2 on not found
> + * @param tag		tag value
> + * @return		0 if tag is real, 1 if tag is an extension, 2 on not found

I prpopose to change the return code semantics: rpmTagIsExtension
is designed to return 3 possible values: yes, no or error.
1 is a good choise for yes, so it is OK
0 is a good choise for no, so it is OK
But for the error — not found — it is better to use -1 to comply
with commonly used semantics.

Best regards,
Andrew Savchenko
----------- следующая часть -----------
Было удалено вложение не в текстовом формате...
Имя     : отсутствует
Тип     : application/pgp-signature
Размер  : 833 байтов
Описание: отсутствует
Url     : <http://lists.altlinux.org/pipermail/devel/attachments/20200411/0d034b07/attachment.bin>


Подробная информация о списке рассылки Devel