Michal and I debugged this over IRC, and tracked it down. He had an
/etc/apt/apt.conf with explicitly setting Architecture:, and creating an
apt.Cache(rootdir="...") object still takes that global configuration
into account.

The attached test script works on a default installation, downloads the
armhf saucy main index, and creates
/tmp/r/var/lib/apt/lists/ports.ubuntu.com_dists_saucy_main_binary-
armhf_Packages.

But Michal has something like this config:

echo 'APT::Architectures:: "amd64";' | sudo tee
/etc/apt/apt.conf.d/01explicit_arch

After doing that, running the test script shows the same failure:

Err http://ports.ubuntu.com saucy/main amd64 Packages                           
                                                                             
Get:4 http://ports.ubuntu.com saucy/main armhf Packages [1219 kB]
[...]
E:Some index files failed to download. They have been ignored, or old ones used 
instead.

So, it might certainly be that I'm using python-apt wrongly here, but I
would certainly expect apt.Cache(rootdir=/path/to/my/sandbox) to not
consider anything from /etc/apt/?

** Attachment added: "test script"
   
https://bugs.launchpad.net/ubuntu/+source/python-apt/+bug/1238616/+attachment/3874724/+files/test.py

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1238616

Title:
  creating apt cache with rootdir= still considers global apt config

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/python-apt/+bug/1238616/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to