enable_component() does not enable components for deb-src lines

Bug #758732 reported by Oliver Grawert
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-apt (Ubuntu)
Fix Released
Medium
Stéphane Graber
Natty
Fix Released
Medium
Stéphane Graber

Bug Description

Binary package hint: python-apt

while the python-apt documentation says the following for the enable_component method:

     | enable_component(self, comp)
     | Enable a component in all main, child and source code sources
     | (excluding cdrom based sources)
     |
     | comp: the component that should be enabled

using a script like http://paste.ubuntu.com/592844/ results in a sources.list like: http://paste.ubuntu.com/593101/
apparently deb-src lines are ignored ...

Oliver Grawert (ogra)
Changed in python-apt (Ubuntu Natty):
importance: Undecided → Medium
milestone: none → ubuntu-11.04
Changed in python-apt (Ubuntu Natty):
assignee: nobody → Stéphane Graber (stgraber)
Revision history for this message
Julian Andres Klode (juliank) wrote :

Stephane: Oh no, you stole my bug for wednesday. (And I stole my special characters)

Anyway, this should be tried on a list without commented-out lines, and see if it works
there.

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

Sorry :)

The function just wasn't doing anything on -src lines, it was a two lines change to have it apply to src entries too:

=== modified file 'aptsources/distro.py'
--- aptsources/distro.py 2010-10-18 09:51:44 +0000
+++ aptsources/distro.py 2011-04-12 14:49:20 +0000
@@ -337,6 +337,9 @@
             for source in sources:
                 add_component_only_once(source, comps_per_dist)

+ for source in self.source_code_sources:
+ add_component_only_once(source, comps_per_sdist)
+
         # check if there is a main source code source at all
         if self.get_source_code == True:
             if len(self.source_code_sources) < 1:

So it now iterates through both binary and source entries.

Behaviour on my test file is now identical for both binary and source entries:

root@stgraber-vm:~# diff -Nrup /root/sources.list /etc/apt/sources.list
--- /root/sources.list 2011-04-12 10:54:12.327508252 -0400
+++ /etc/apt/sources.list 2011-04-12 10:54:17.717508232 -0400
@@ -1,15 +1,15 @@
-deb http://archive.ubuntu.com/ubuntu natty main restricted
-deb http://archive.ubuntu.com/ubuntu natty-updates main restricted
-deb http://archive.ubuntu.com/ubuntu natty-security main restricted
+deb http://archive.ubuntu.com/ubuntu natty main restricted universe multiverse
+deb http://archive.ubuntu.com/ubuntu natty-updates main restricted universe multiverse
+deb http://archive.ubuntu.com/ubuntu natty-security main restricted universe multiverse

-#deb http://archive.ubuntu.com/ubuntu natty main restricted
-#deb http://archive.ubuntu.com/ubuntu natty-updates main restricted
-#deb http://archive.ubuntu.com/ubuntu natty-security main restricted
+# deb http://archive.ubuntu.com/ubuntu natty main restricted
+# deb http://archive.ubuntu.com/ubuntu natty-updates main restricted
+# deb http://archive.ubuntu.com/ubuntu natty-security main restricted

-deb-src http://archive.ubuntu.com/ubuntu natty main restricted
-deb-src http://archive.ubuntu.com/ubuntu natty-updates main restricted
-deb-src http://archive.ubuntu.com/ubuntu natty-security main restricted
+deb-src http://archive.ubuntu.com/ubuntu natty main restricted universe multiverse
+deb-src http://archive.ubuntu.com/ubuntu natty-updates main restricted universe multiverse
+deb-src http://archive.ubuntu.com/ubuntu natty-security main restricted universe multiverse

-#deb-src http://archive.ubuntu.com/ubuntu natty main restricted
-#deb-src http://archive.ubuntu.com/ubuntu natty-updates main restricted
-#deb-src http://archive.ubuntu.com/ubuntu natty-security main restricted
+# deb-src http://archive.ubuntu.com/ubuntu natty main restricted
+# deb-src http://archive.ubuntu.com/ubuntu natty-updates main restricted
+# deb-src http://archive.ubuntu.com/ubuntu natty-security main restricted

Changed in python-apt (Ubuntu Natty):
status: New → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

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

  * Update enable_component to also apply to -src entries (LP: #758732)
 -- Stephane Graber <email address hidden> Tue, 12 Apr 2011 10:49:34 -0400

Changed in python-apt (Ubuntu Natty):
status: Fix Committed → Fix Released
Revision history for this message
Oliver Grawert (ogra) wrote :

still present on omap4 ... the original sources.list looks like:

deb http://ports.ubuntu.com/ubuntu-ports natty main restricted
deb-src http://archive.ubuntu.com/ubuntu natty main restricted

deb http://ports.ubuntu.com/ubuntu-ports natty-security main restricted
deb-src http://archive.ubuntu.com/ubuntu natty-security main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://ports.ubuntu.com/ubuntu-ports natty-updates main restricted
deb-src http://archive.ubuntu.com/ubuntu natty-updates main restricted

## Uncomment the following two lines to add software from the 'universe'
## repository.
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
# deb http://ports.ubuntu.com/ubuntu-ports natty universe
# deb-src http://archive.ubuntu.com/ubuntu natty universe
# deb http://ports.ubuntu.com/ubuntu-ports natty-updates universe
# deb-src http://archive.ubuntu.com/ubuntu natty-updates universe
# deb http://ports.ubuntu.com/ubuntu-ports natty-security universe
# deb-src http://archive.ubuntu.com/ubuntu natty-security universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
# deb http://ports.ubuntu.com/ubuntu-ports natty multiverse
# deb-src http://archive.ubuntu.com/ubuntu natty multiverse
# deb http://ports.ubuntu.com/ubuntu-ports natty-updates multiverse
# deb-src http://archive.ubuntu.com/ubuntu natty-updates multiverse
# deb http://ports.ubuntu.com/ubuntu-ports natty-security multiverse
# deb-src http://archive.ubuntu.com/ubuntu natty-security multiverse

Revision history for this message
Oliver Grawert (ogra) wrote :

the modified sources.list after running the above mentioned script is:

deb http://ports.ubuntu.com/ubuntu-ports natty main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu natty main restricted

deb http://ports.ubuntu.com/ubuntu-ports natty-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu natty-security main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://ports.ubuntu.com/ubuntu-ports natty-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu natty-updates main restricted

## Uncomment the following two lines to add software from the 'universe'
## repository.
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
# deb http://ports.ubuntu.com/ubuntu-ports natty universe
# deb-src http://archive.ubuntu.com/ubuntu natty universe
# deb http://ports.ubuntu.com/ubuntu-ports natty-updates universe
# deb-src http://archive.ubuntu.com/ubuntu natty-updates universe
# deb http://ports.ubuntu.com/ubuntu-ports natty-security universe
# deb-src http://archive.ubuntu.com/ubuntu natty-security universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
# deb http://ports.ubuntu.com/ubuntu-ports natty multiverse
# deb-src http://archive.ubuntu.com/ubuntu natty multiverse
# deb http://ports.ubuntu.com/ubuntu-ports natty-updates multiverse
# deb-src http://archive.ubuntu.com/ubuntu natty-updates multiverse
# deb http://ports.ubuntu.com/ubuntu-ports natty-security multiverse
# deb-src http://archive.ubuntu.com/ubuntu natty-security multiverse

Changed in python-apt (Ubuntu Natty):
status: Fix Released → New
Michael Vogt (mvo)
Changed in python-apt (Ubuntu Natty):
status: New → Fix Committed
Revision history for this message
Stéphane Graber (stgraber) wrote :

Ok, Oliver's bug is a different issue. I'm marking this one as fix released again and will open a separate bug report with details on what's going on above.

Changed in python-apt (Ubuntu Natty):
status: Fix Committed → Fix Released
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.