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

Re: Using python-apt's apt_pkg with a chroot



On 12/2/25 6:36 PM, Sebastiaan Couwenberg wrote:
Using python-apt's apt_pkg with a chroot turns out to be non-trivial unlike apt.cache.

I'm running a script [0] on a trixie system and need to interact with the cache in a testing chroot.

The chroot is created with mmdebstrap --mode=unshare, and the script is run via unshare as well.

Setting RootDir in the config does not result in the chroot paths to be used:

This seems to be an issue with python-apts apt_pkg, because Perl AptPkg works as expected:

 $ unshare --map-auto --map-user=65536 --map-group=65536 --keep-caps -- ~/git/release-team/release.debian.org/bin/resolve-dependencies.pl
 Package: opencv
 Version: 4.10.0+dfsg-6
 Source:  https://deb.debian.org/debian/pool/main/o/opencv/opencv_4.10.0%2bdfsg-6.dsc

This Perl script [1] is getting the data for testing by using the chroot.

[1] https://salsa.debian.org/sebastic/release.debian.org/-/blob/a6708dcc8e00ce1e16b1cd94909890e8098ea2f5/bin/resolve-dependencies.pl

Kind Regards,

Bas

--
 PGP Key ID: 4096R/6750F10AE88D4AF1
Fingerprint: 8182 DE41 7056 408D 6146  50D1 6750 F10A E88D 4AF1


Reply to: