pkg.current_ver is always None despite its status in Installed in dpkg status file.
>>> import apt >>> c = apt.Cache(rootdir = '/home/ubuntu/update-manager-0.174.3/tests/aptroot-update-origin') >>> c.update() True >>> c.open() >>> p=c['python-libvirt'] >>> p._pkg.current_ver >>>
$ ls -l /home/ubuntu/update-manager-0.174.3/tests/aptroot-update-origin/var/lib/dpkg/status -rw-r--r-- 1 root root 11185 Dec 13 10:04 /home/ubuntu/update-manager-0.174.3/tests/aptroot-update-origin/var/lib/dpkg/status
$ head -5 /home/ubuntu/update-manager-0.174.3/tests/aptroot-update-origin/var/lib/dpkg/status Package: python-libvirt Status: install ok installed Installed-Size: 1 Version: 0.7.5-5ubuntu27.16 Description: foo
pkg.current_ver is always None despite its status in Installed in dpkg status file.
>>> import apt ubuntu/ update- manager- 0.174.3/ tests/aptroot- update- origin' ) libvirt' ]
>>> c = apt.Cache(rootdir = '/home/
>>> c.update()
True
>>> c.open()
>>> p=c['python-
>>> p._pkg.current_ver
>>>
$ ls -l /home/ubuntu/ update- manager- 0.174.3/ tests/aptroot- update- origin/ var/lib/ dpkg/status update- manager- 0.174.3/ tests/aptroot- update- origin/ var/lib/ dpkg/status
-rw-r--r-- 1 root root 11185 Dec 13 10:04 /home/ubuntu/
$ head -5 /home/ubuntu/ update- manager- 0.174.3/ tests/aptroot- update- origin/ var/lib/ dpkg/status
Package: python-libvirt
Status: install ok installed
Installed-Size: 1
Version: 0.7.5-5ubuntu27.16
Description: foo