[Rpm-ecosystem] rpm debugedit as a separate project?

Mark Wielaard mark at klomp.org
Sun Feb 21 19:13:34 UTC 2021


Hi,

rpm-ecosystem at lists.rpm.org wrote:
> On Fri, Feb 19, 2021 at 09:23:58PM +0100, Mark Wielaard wrote:
> The main obstacle is that tools/debugedit.c currently depends on rpm:
>
> $ git grep -h rpm tools/debugedit.c
> #include <rpm/rpmio.h>
> #include <rpm/rpmpgp.h>
>       if (rpmDigestLength(algorithm) == build_id_size)
>   ctx = rpmDigestInit(algorithm, 0);
>     rpmDigestUpdate(ctx, build_id_seed, strlen (build_id_seed));
> 	rpmDigestUpdate(ctx, x.d_buf, x.d_size);
> 	  rpmDigestUpdate(ctx, x.d_buf, x.d_size);
> 	      rpmDigestUpdate(ctx, d->d_buf, d->d_size);
>   rpmDigestFinal(ctx, &digest, &len, 0);

Right. Forgot about needing a hashing algorithm for recreating an unique build-id. This shouldn't be too hard. We can use some libiberty or binutils code for that when we are upgrading the hashtab code. The only trickI part is that the above let's you support arbitrary sized build-ids. But in practice all build-ids have the same size and there are other techniques for chsanging hash sizes.

Thanks,

Mark


More information about the Rpm-ecosystem mailing list