[Libosinfo] [libosinfo PATCH 1/3] osinfo-query: Add osinfo_os_list_func to OsinfoLabel

Michal Privoznik mprivozn at redhat.com
Mon Apr 15 09:29:52 UTC 2019


On 4/15/19 9:58 AM, Fabiano Fidêncio wrote:
> Let's add a new osinfo_os_list_func to OsinfoLabel. This function
> represents any osinfo_os_get.*_list() and can be used to get Os specific
> attributes list.
> 
> One example of usage for this is osinfo_os_get_variant_list() and then
> be able to also display the os variants when querying for an Os.
> 
> https://gitlab.com/libosinfo/libosinfo/issues/24
> 
> Signed-off-by: Fabiano Fidêncio <fidencio at redhat.com>
> ---
>   tools/osinfo-query.c | 64 +++++++++++++++++++++++---------------------
>   1 file changed, 33 insertions(+), 31 deletions(-)
> 
> diff --git a/tools/osinfo-query.c b/tools/osinfo-query.c
> index 00f838b..045f3c1 100644
> --- a/tools/osinfo-query.c
> +++ b/tools/osinfo-query.c


>   static struct OsinfoLabel device_labels[] = {
>       { OSINFO_DEVICE_PROP_VENDOR,
> -      N_("Vendor"), TRUE, 20 },
> +      N_("Vendor"), TRUE, 20, NULL },
>       { OSINFO_DEVICE_PROP_VENDOR_ID,
> -      N_("Vendor ID"), TRUE, 12 },
> +      N_("Vendor ID"), TRUE, 12, NULL },
>       { OSINFO_DEVICE_PROP_PRODUCT,
> -      N_("Product"), TRUE, 20 },
> +      N_("Product"), TRUE, 20 ,NULL },

Incorrect white spacing.

>       { OSINFO_DEVICE_PROP_PRODUCT_ID,
> -      N_("Product ID"), TRUE, 12 },
> +      N_("Product ID"), TRUE, 12, NULL },
>       { OSINFO_PRODUCT_PROP_NAME,
> -      N_("Name"), TRUE, 14 },
> +      N_("Name"), TRUE, 14, NULL },
>       { OSINFO_DEVICE_PROP_CLASS,
> -      N_("Class"), TRUE, 15 },
> +      N_("Class"), TRUE, 15, NULL },
>       { OSINFO_DEVICE_PROP_BUS_TYPE,
> -      N_("Bus"), TRUE, 8 },
> +      N_("Bus"), TRUE, 8, NULL },
>       { OSINFO_ENTITY_PROP_ID,
> -      N_("ID"), TRUE, 40 },
> -    { NULL, NULL, 0, 0 },
> +      N_("ID"), TRUE, 40, NULL },
> +    { NULL, NULL, 0, 0, NULL },
>   };

Michal




More information about the Libosinfo mailing list