patch rfc: debuginfod -Z (generalized archive) support

Mark Wielaard
Fri Feb 7 09:24:00 GMT 2020

Hi Frank,

On Wed, Feb 05, 2020 at 03:09:18PM -0500, Frank Ch. Eigler wrote:
> A little extension lets us process arch-linux archives.  Awaiting
> for some small test .pkg's from the arch folks for the elfutils
> testsuite.  However, hand-testing on severa larger files works!
> commit b51ae89befeb81c8b51b15b7168c6e616255b486 (fche/pacman-Z)
> Author: Frank Ch. Eigler <>
> Date:   Wed Feb 5 15:04:18 2020 -0500
>     debuginfod: generalized archive support
>     Add a '-Z EXT=CMD' option to debuginfod, which lets it scan any given
>     extension and run CMD on it to unwrap distro archives.  For example,
>     for arch-linux pacman files, -Z '.tar.zst=zstdcat' lets debuginfod
>     grok debug and source content in split-debuginfo files.
> diff --git a/debuginfod/ChangeLog b/debuginfod/ChangeLog
> index 8c97fdcf7085..d812e6d71ff0 100644
> --- a/debuginfod/ChangeLog
> +++ b/debuginfod/ChangeLog
> @@ -1,3 +1,9 @@
> +2020-02-05  Frank Ch. Eigler  <>
> +
> +	* debuginfod.cxx (argp options): Add -Z option.
> +	(canonicalized_archive_entry_pathname): New function for
> +	distro-agnostic file name matching/storage.

I really like how simple adding this feature is. Shows the design for
adding new formats was done with some foresight.

But the simplicity also confused me at first. And I think it might
also confuse users and that it might be less efficient than it could
be. What this "hides" is that archiving is done in two steps. First
converting the package into an archive that libarchive can handle,
then going through and indexing the files in the archive.

For the first step for rpms we use rpm2cpio, for debs dpkg-deb, but as
your example shows for some other packaging formats we don't actually
need any conversion step. And so the man page example uses cat as if
it is an identity operation on the file.

I think it would be better if you could simply leave off the
conversion CMD and just provide an EXT (without =). This would then
just pass the file with the given extension to libarchive directly
(then you also don't need the zstdcat conversion). And letting
libarchive handle it directly might be more efficient.



More information about the Elfutils-devel mailing list