[Yum-devel] Honor --queryformat when using --output=ascii-tree

James Laska jlaska at redhat.com
Thu Jan 19 19:15:03 UTC 2012


Greetings,

> GIT: [PATCH] Honor --queryformat when using --output=ascii-tree

While using --output=ascii-tree, I found it desirable to influence the format
of the package name.  In my particular case, I wanted to include %{repoid}
along with the standard nvra format.

The attached patch uses the value stored in queryformat to display the package
within _tree_print_req().  I'm not familiar with the yum codebase, or yum
objects, but I'm fairly certain this isn't the _proper_ way to instrument this
feature.  I couldn't determine how best to add queryformat capability to one of
the underlying objects (e.g. PackageObject).

Sample output before applying the patch is included below:

> |   \_  python-httplib2-0.6.0-4.el6_0.noarch [1: python-httplib2]
> |   |   \_  python-2.6.6-29.el6.x86_64 [1: python(abi) = 2.6]
> |   \_  python-libguestfs-1.7.17-26.el6.x86_64 [1: python-libguestfs]
> |   |   \_  glibc-2.12-1.47.el6.x86_64 [2: libc.so.6()(64bit), libc.so.6(GLIBC_2.2.5)(64bit)]

Sample output after applying the patch is included below:

> |   \_  python-httplib2-0.6.0-4.el6_0.noarch (repo: ce-rhel-6-candidate) [1: python-httplib2]
> |   |   \_  python-2.6.6-29.el6.x86_64 (repo: rhel-6) [1: python(abi) = 2.6]
> |   \_  python-libguestfs-1.7.17-26.el6.x86_64 (repo: rhel-6-optional) [1: python-libguestfs]
> |   |   \_  glibc-2.12-1.47.el6.x86_64 (repo: rhel-6) [2: libc.so.6()(64bit), libc.so.6(GLIBC_2.2.5)(64bit)]

Suggestions/comments encouraged.

Thanks,
James


More information about the Yum-devel mailing list