Ubuntu.info template doesn't allow deb-src lines using archive.ubuntu.com on ports architectures

Bug #760035 reported by Stéphane Graber
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-apt (Ubuntu)
Fix Released
High
Unassigned
Natty
Fix Released
High
Unassigned

Bug Description

Binary package hint: python-apt

On ports architecture (!= i386 and != amd64), Ubuntu.info says that only http://ports.ubuntu.com/ubuntu-ports is valid for an official repository.

Unfortunately all current ARM (maybe other) builds are using http://ports.ubuntu.com/ubuntu-ports for binary packages and http://archive.ubuntu.com/ubuntu for source packages.

So running:
---
#!/usr/bin/python
import aptsources.distro
from aptsources.sourceslist import SourcesList, SourceEntry

list=SourcesList()
distro=aptsources.distro.get_distro()
distro.get_sources(list)
distro.enable_component("universe")
distro.enable_component("multiverse")
list.save()
---

On ARM with the default sources.list, will only modify the "deb" entries and not the "deb-src" ones.

As archive.ubuntu.com is a perfectly valid source for source packages on ports architectures, it should be allowed.

Tags: patch
Changed in python-apt (Ubuntu Natty):
milestone: none → ubuntu-11.04
status: New → Triaged
importance: Undecided → High
Revision history for this message
Stéphane Graber (stgraber) wrote :

Ok, I have a tentative fix for this bug.

Here's my test sources.list before (containing both valid and invalid entries):

# Valid binary entries
deb http://ports.ubuntu.com/ubuntu-ports natty main restricted
deb http://ports.ubuntu.com/ubuntu-ports natty-security main restricted
deb http://ports.ubuntu.com/ubuntu-ports natty-updates main restricted

# Valid source entries
deb-src http://ports.ubuntu.com/ubuntu-ports natty main restricted
deb-src http://security.ubuntu.com natty-security main restricted
deb-src http://archive.ubuntu.com/ubuntu natty-updates main restricted

# Invalid binary entry
deb http://archive.ubuntu.com/ubuntu natty-proposed main restricted

After running the modified python-apt, I get:

# Valid binary entries
deb http://ports.ubuntu.com/ubuntu-ports natty main restricted universe multiverse
deb http://ports.ubuntu.com/ubuntu-ports natty-security main restricted universe multiverse
deb http://ports.ubuntu.com/ubuntu-ports natty-updates main restricted universe multiverse

# Valid source entries
deb-src http://ports.ubuntu.com/ubuntu-ports natty main restricted universe multiverse
deb-src http://security.ubuntu.com natty-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu natty-updates main restricted universe multiverse

# Invalid binary entry
deb http://archive.ubuntu.com/ubuntu natty-proposed main restricted

Revision history for this message
Stéphane Graber (stgraber) wrote :

Here's the patch.

It updates sourceslist.py to check that both the template and the source are of the same type or that the template is of type "deb". That means that if we have a template entry defined for deb-src it won't match for a deb line. But that a template entry defined for deb will match a deb-src line.

It also updates Ubuntu.info to define deb-src entries for all the natty sources, match all (I hope) the possible sources for deb-src repositories.
For now it doesn't do anything for deb-src and the mirrors as I'm not sure all mirrors, not sure if we want to allow them too ?

tags: added: patch
Revision history for this message
Michael Vogt (mvo) wrote :

Thanks, that looks good, but I will have a closer look tomorrow moring.

Revision history for this message
Michael Vogt (mvo) wrote :

Hm, I get test failures now during bzr-buildpackage so this needs some closer inspection.

Revision history for this message
Michael Vogt (mvo) wrote :

With the patch:

$ python setup.py build
$ python tests/test_all.py
[tests] Running on 2.7.1+ (r271:86832, Apr 11 2011, 18:13:53) [GCC 4.5.2]
Reading package lists... Done
Building dependency tree
Reading state information... Done
...F.............................
======================================================================
FAIL: testMatcher (test_aptsources.TestAptSources)
aptsources: Test matcher
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/egon/devel/python-apt/r420/tests/test_aptsources.py", line 145, in testMatcher
    self.fail("source entry '%s' has no matcher" % s)
AssertionError: source entry 'deb cdrom:[Ubuntu 8.10 _Intrepid Ibex_ - Alpha]/ intrepid main' has no matcher

Revision history for this message
Stéphane Graber (stgraber) wrote :

Ok, the issue is that some template have template.type set to None. I updated the condition to return a match if:
template.type == source.type or template.type is None or "deb"

I also tried the unit tests with the change (sorry, I completely forgot to do it last time) and they now pass properly.

Revision history for this message
Stéphane Graber (stgraber) wrote :

stgraber@castiana:~/Desktop/python-apt/ubuntu/tests$ python test_all.py
[tests] Running on 2.7.1+ (r271:86832, Apr 11 2011, 18:13:53) [GCC 4.5.2]
Reading package lists... Done
Building dependency tree
Reading state information... Done
.................................
----------------------------------------------------------------------
Ran 37 tests in 5.044s

OK

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package python-apt - 0.7.100.3ubuntu5

---------------
python-apt (0.7.100.3ubuntu5) natty; urgency=low

  [ Stéphane Graber ]
  * fix enable_components for deb-src entries on ports.ubuntu.com
    (LP: #760035)
 -- Michael Vogt <email address hidden> Wed, 20 Apr 2011 18:05:51 +0200

Changed in python-apt (Ubuntu Natty):
status: Triaged → Fix Released
Revision history for this message
Ricardo Pérez López (ricardo) wrote :

This change seems to introduce a very visible issue in software-properties, as you can see in bug #768469 and its duplicates.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.