[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Perl AptPkg bindings: no binpkg(name, ver) -> srcpkg(name, ver) mapping?



Hello fellow developers


I'm currently using the Perl AptPkg bindings to read and handle package cache metadata.

I'd like to map a bin:pkg name and version to its corresponding src:pkg ame and version, but unless I missed something, this doesn't seem to be possible?

Mapping a bin:pkg name to a src:pkg is easy, through AptPkg::Source(->find), but getting the correct version seems to be impossible.

Generally, binary and source package versions may not be identical, e.g., lvm2 -⁠> dmsetup.

While AptPkg::Source->find will return a list of source packages for a given binary package, if the list contains multiple entries, there's no way to tell which entry might be a appropriate for a given bin:pkg version, since while the AptPkg::Source data contains a list of bin:pkgs, these are unversioned.

Likewise, looking up an AptPkg::Cache::VerFile object via AptPkg::PkgRecords-⁠>lookup will return a SourcePkg hash field, but the data in there is also just the unversioned source package name.


Contrary to that, the apt_pkg python bindings do provide a source_ver method as part of its PackageRecords class, which is pretty much exactly what one would need.


Have a I missed anything and just not looked deeply enough into AptPkg, or is what I want to do really impossible?




Mihai

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature


Reply to: