[Rpm-ecosystem] nvr and nevra parsing functions

Honza Silhan jsilhan at redhat.com
Tue Mar 14 12:36:17 UTC 2017


On Wed, Mar 1, 2017 at 4:50 PM, Julius Milan <jmilan at redhat.com> wrote:
> Hi rpm people

Hi Julius,

> I would like to ask you about adding functions for parsing information from nvr and maybe nevra strings.
> As hawkey library became obsolete, we didn't find any replacement for some its functions as hy_split_nevra.
>
> I am interested in function with api as:
> int parse_nvr_name(const char *nvr, char **name);    // to parse just name, (allocates memory for it)

I believe that currently from libdnf API you are able to do nevra
parsing by `hy_subject_nevra_possibilities`,
`hy_possibilities_next_nevra` and `hy_nevra_get_string(HyNevra nevra,
HY_NEVRA_NAME)`.

> But you may want to add also something like: (hy_split_nevra equivalent)
> int parse_nevra_all(const char *nevra, char **name, long int *epoch, char **version, char **release, char **arch);

IMO The best place having `parse_nevra_all` function would be RPM.


Honza


More information about the Rpm-ecosystem mailing list