One thing I didn't realize until now is that this failing test that I'm debugging should not be affected by multi-arch because it uses a separate cache configured for armel, which AIUI, should not have multi-arch. After realizing this and digging a bit more, I've came up with the test-case below, where apt_pkg.Cache.is_multi_arch is set to True even though we set the architecture to armel. This seems to be because the rootdir passed to apt.cache.Cache is not passed down to apt_pkg.Cache, so the latter is reading the configs from the system.
One thing I didn't realize until now is that this failing test that I'm debugging should not be affected by multi-arch because it uses a separate cache configured for armel, which AIUI, should not have multi-arch. After realizing this and digging a bit more, I've came up with the test-case below, where apt_pkg. Cache.is_ multi_arch is set to True even though we set the architecture to armel. This seems to be because the rootdir passed to apt.cache.Cache is not passed down to apt_pkg.Cache, so the latter is reading the configs from the system.
import os, tempfile
from apt.cache import Cache
tempdir = tempfile. mkdtemp( prefix= "hwpack- apt-cache- ") os.path. join(tempdir, "etc", "apt")) join(tempdir, "etc", "apt", "apt.conf")
'Install- Recommends "true";\n}\n')
os.makedirs(
apt_conf = os.path.
with open(apt_conf, 'w') as f:
f.write(
'Apt {\nArchitecture armel;\n'
c = Cache(rootdir= tempdir, memonly=True) _have_multi_ arch: ", c._have_multi_arch _cache. is_multi_ arch: ", c._cache. is_multi_ arch
print "Cache.
print "Cache.