[Rpm-ecosystem] python-dnf question: installed vs. available checksums
jmracek at redhat.com
Fri Aug 4 11:16:30 UTC 2017
I see a possible solution:
a = base.sack.query().filter(name='TestA')
for pkg in a:
yumdb_info = base._yumdb.get_package(pkg)
type, checksum = pkg.returnIdSum()
But it uses private object _yumdb. In near future we will replace it with SWDB.
Have a nice time
On Wed, Aug 2, 2017 at 5:52 PM, Ian Pilcher <arequipeno at gmail.com> wrote:
> I would like to the the DNF API (python-dnf) to determine the source
> repository for the packages that are installed on a system. (I am aware
> that this is not necessarily possible for every package, but it should
> be possible for the vast majority of packages on an up-to-date system.)
> It is straightforward to iterate through the installed packages and
> search for matching packages in a sack that was filled with
> fill_sack(load_system_repo=False, load_available_repos=True) --
> filtering on either NVRA or NEVRA.
> If possible, I would like to take the further step of validating that
> checksum of the installed package matches that of any available
> packages. However, I'm having trouble figuring out how to do this. It
> seems that installed packages have only a hdr_chksum attribute while
> available packages have only a chksum attribute. (Attempting to read
> the hdr_chksum of an available package or the chksum attribute of an
> installed packages raises a "No such checksum" AttributeError.
> Is the NVRA/NEVRA match the best that can be done?
> Ian Pilcher arequipeno at gmail.com
> -------- "I grew up before Mark Zuckerberg invented friendship" --------
> Rpm-ecosystem mailing list
> Rpm-ecosystem at lists.rpm.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Rpm-ecosystem