Python-apt shows empty origins object

Bug #704595 reported by Nicolas Valcarcel on 2011-01-18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
apt (Ubuntu)

Bug Description

Binary package hint: python-apt

Steps to reproduce:
$ mkdir -p /tmp/apt-test/etc/apt
$ cp /etc/apt/sources.list /tmp/apt-test/etc/apt/.

- Run the following code in a python shell:
import apt

cache = apt.Cache(rootdir='/tmp/apt-test/')

for package in cache:
    foo = package

- Inspect the object and this is what you will get:
[<Origin component:'' archive:'' origin:'' label:'' site:'' isTrusted:False>]

Expected results:
[<Origin component:'universe' archive:'maverick' origin:'Ubuntu' label:'Ubuntu' site:'' isTrusted:True>]

description: updated
description: updated
Julian Andres Klode (juliank) wrote :

I can reproduce this and will take a closer look at it soon

Changed in python-apt (Ubuntu):
assignee: nobody → Julian Andres Klode (juliank)
status: New → Confirmed
Julian Andres Klode (juliank) wrote :

That's a bug in APT.

affects: python-apt (Ubuntu) → apt (Ubuntu)
Changed in apt (Ubuntu):
assignee: Julian Andres Klode (juliank) → nobody
Nicolas Valcarcel (nvalcarcel) wrote :

How did you tested that? Is there a test case i can use to debug apt to see where is the problem?

Nicolas Valcarcel (nvalcarcel) wrote :

Ok, seem to get the problem:

nxvl [~]
Sylvester$ apt-get -o Dir=/tmp/apt-test/ update
W: GPG error: maverick Release: No keyring installed in /tmp/apt-test/etc/apt/trusted.gpg.d/.
W: GPG error: maverick-security Release: No keyring installed in /tmp/apt-test/etc/apt/trusted.gpg.d/.
W: GPG error: maverick Release: No keyring installed in /tmp/apt-test/etc/apt/trusted.gpg.d/.
W: GPG error: maverick Release: No keyring installed in /tmp/apt-test/etc/apt/trusted.gpg.d/.
W: GPG error: maverick-updates Release: No keyring installed in /tmp/apt-test/etc/apt/trusted.gpg.d/.
W: GPG error: maverick-backports Release: No keyring installed in /tmp/apt-test/etc/apt/trusted.gpg.d/.
W: GPG error: maverick-proposed Release: No keyring installed in /tmp/apt-test/etc/apt/trusted.gpg.d/.

Shouldn't apt try to use the system keyring here? Or at least create "/tmp/apt-test/etc/apt/trusted.gpg.d/."?

Nicolas Valcarcel (nvalcarcel) wrote :

Issue is not present in Lucid

Julian Andres Klode (juliank) wrote :

So, we basically fetch the Release files, but as verification fails, we never move them out of partial/. Fixing this involves changing the acquire system to always move release files. This gets difficult though, because inRelease files are always trusted and thus cannot be just moved.

Julian Andres Klode (juliank) wrote :

A patch. I'm not sure whether this is the right way to go, though.

Julian Andres Klode (juliank) wrote :

This bug has been fixed in revision 2105 of the debian-sid branch, the
fix can be found at:

revno: 2105
fixes bug(s):
committer: Julian Andres Klode <email address hidden>
branch nick: debian-sid
timestamp: Fri 2011-04-08 13:57:04 +0200
  * apt-pkg/
    - Use Release files even if they cannot be verified (LP: #704595)

Changed in apt (Ubuntu):
status: Confirmed → Fix Committed
tags: added: patch

Fixed typo in title:

summary: - Python-apt shows emply origins object
+ Python-apt shows empty origins object
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apt -

apt ( oneiric; urgency=low

  [ Michael Vogt ]
  * merged from the debian-sid bzr branch

  [ Julian Andres Klode ]
  * apt-pkg/
    - Really release action groups only once (Closes: #622744)
    - Make purge work again for config-files (LP: #244598) (Closes: #150831)
  * debian/apt.cron.daily:
    - Check power after wait, patch by manuel-soto (LP: #705269)
  * debian/control:
    - Move ${shlibs:Depends} to Pre-Depends, as we do not want APT
      unpacked if a library is too old and thus break upgrades
  * doc/apt-key.8.xml:
    - Document apt-key net-update (LP: #192810)

apt ( unstable; urgency=low

  * apt-pkg/
    - Only try to rename existing Release files (Closes: #622912)

apt (0.8.14) unstable; urgency=low

  [ Julian Andres Klode ]
  * apt-pkg/
    - Use RealFileExists() instead of FileExists(), allows amongst other
      things a directory named Sources to exist on a CD-ROM (LP: #750694).
  * apt-pkg/
    - Use Release files even if they cannot be verified (LP: #704595)
  * cmdline/
    - Do not install recommends for build-dep (Closes: #454479) (LP: #245273)
  * apt-pkg/deb/
    - Handle no space before "[" in build-dependencies (LP: #72344)
  * apt-pkg/
    - Allow pinning by glob() expressions, and regular expressions
      surrounded by slashes (the "/" character) (LP: #399474)
      (Closes: #121132)
  * debian/control:
    - Set Standards-Version to 3.9.2

  [ Michael Vogt ]
  * mirror method:
    - do not crash if the mirror file fails to download
  * apt-pkg/
    - fix comparing for a empty string
  * debian/apt.cron.daily:
    - run unattended-upgrades even if there was a error during
      the apt-get update (LP: #676295)

  [ David Kalnischkies ]
  * apt-pkg/
    - use the native Architecture stored in the cache header instead of
      loading it from configuration as suggested by Julian Andres Klode
 -- Michael Vogt <email address hidden> Fri, 29 Apr 2011 17:55:20 +0200

Changed in apt (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers