Comment 2 for bug 758732

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