sourceslist.SourcesList doesn't reuse disabled sources entries
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-apt (Ubuntu) |
Fix Released
|
Medium
|
Sami Jaktholm |
Bug Description
If sourceslist contains a disabled entry (commented out) and the exactly same entry is added with sourceslist.
Steps to reproduce:
1. Add a repository:
# apt-add-repository 'deb http://
2. Edit sources.list and comment out the newly added entry
3. Add it again:
# apt-add-repository 'deb http://
4. Notice the duplicated lines: one disabled, the other enabled
What should happen:
4. The disabled line is now enabled.
Why this happens:
On line 316 the condition 'set(source.comps) == comps' will always be False (at least with python 2.7 and 3.2) as you can see doing following in a python shell:
>>> set([]) == []
False
>>> set(["precise", "main"]) == ["precise", "main"] # this was the case in the example above.
False
ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: python-apt 0.8.3ubuntu7
ProcVersionSign
Uname: Linux 3.2.0-29-generic x86_64
ApportVersion: 2.0.1-0ubuntu12
Architecture: amd64
Date: Tue Aug 28 22:02:45 2012
InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Release amd64 (20120425)
ProcEnviron:
TERM=xterm
PATH=(custom, no user)
LANG=fi_FI.UTF-8
SHELL=/bin/bash
SourcePackage: python-apt
UpgradeStatus: No upgrade log present (probably fresh install)
Related branches
- Michael Vogt: Approve
-
Diff: 37 lines (+15/-1)2 files modifiedaptsources/sourceslist.py (+1/-1)
tests/test_aptsources.py (+14/-0)
Changed in python-apt (Ubuntu): | |
assignee: | nobody → sampo555 (sampo555) |
status: | Confirmed → In Progress |
Changed in python-apt (Ubuntu): | |
importance: | Undecided → Medium |
Status changed to 'Confirmed' because the bug affects multiple users.