apt-add-repository corrupts sources.list with multiple options

Bug #1103200 reported by Brian Candler
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
python-apt (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

[ubuntu 12.04, python-software-properties 0.82.7.3]

Here is how to reproduce:

echo "deb [arch=amd64 trusted=yes] http://research.cs.wisc.edu/htcondor/debian/stable/ squeeze contrib" >>/etc/apt/sources.list
apt-add-repository ppa:semiosis/ubuntu-glusterfs-3.3 </dev/null
tail -1 /etc/apt/sources.list

It shows:

deb [arch=amd64] trusted=yes] http://research.cs.wisc.edu/htcondor/debian/stable/ squeeze contrib

Notice that an extra right-hand square bracket has been added after arch=amd64, which means that sources.list is now invalid.

If you correct it, then
apt-add-repository --remove ppa:semiosis/ubuntu-glusterfs-3.3 </dev/null
re-introduces the corruption.

Notes:

(1) The format of the options field is defined in the sources.list(5) manpage

(2) [arch=amd64 trusted=yes] is a valid option set, and is required for the htcondor repo, because it doesn't have i386 packages *and* its packages are not signed

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

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in software-properties (Ubuntu):
status: New → Confirmed
Revision history for this message
Rohit R (rr0hit) wrote :

Marking as confirmed, have tracked down the reasons at https://bugs.launchpad.net/ubuntu/+source/python-apt/+bug/1242778

affects: software-properties (Ubuntu) → python-apt (Ubuntu)
Revision history for this message
Julian Andres Klode (juliank) wrote :

python-apt does not support those options currently. I'm looking into it.

Revision history for this message
Julian Andres Klode (juliank) wrote :

A commit was committed to the upstream repository

commit 8a67219266605b39a522aee08bf7cd3b0b6c3a8c
Author: Julian Andres Klode <email address hidden>
Date: Mon Oct 21 20:20:22 2013 +0200

    aptsources: Correctly parse multiple options (LP: #1103200)

    It's still not optimal and we do not support the arch+ and arch-
    options, but it's a beginning.

Changed in python-apt (Ubuntu):
status: Confirmed → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package python-apt - 0.9.0

---------------
python-apt (0.9.0) unstable; urgency=low

  [ Michael Vogt ]
  * some fixes from the "coverity" scan
  * merge from Ubuntu:
    - data/templates/Ubuntu.info.in: add "Saucy Salamander" to
    - debian/control: add "Multi-Arch: allowed"

  [ Julian Andres Klode ]
  * Completely remove all old-API support code
  * Accept bytes object for file names (Closes: #680971)
  * aptsources/sourceslist.py
    - Document correct use of uniq and hide it using __all__ (Closes: #723815)
    - Correctly parse multiple options (LP: #1103200)
  * python/apt_pkgmodule.cc:
    - Fix documentation of version_compare (Closes: #680891)
  * python/cache.cc:
    - Set NoDelete=true when creating Policy, fixes segfault in destructor
  * apt/package.py:
    - Add a Package.has_config_files property (Closes: #712749)
  * tests:
    - Do not set dir::etc::sourceparts to /tmp
  * apt, aptsources:
    - Only call init_config() if not already initialized (Closes: #686403)
  * apt/debfile.py:
    - Pass strip_multi_arch=False to parse_depends. Patch by Michael, tests
      derived from the ones provided by the reporter.
      Closes: #717859. Closes: #717861.
  * doc/source/examples/dpkg-info.py:
    - Use apt_inst.DebFile (Closes: #671784)
  * doc/examples/*.py:
    - Update examples to the new API (Closes: #639022)
  * tests/old/*.py:
    - Update to new API as well
  * data/templates/Ubuntu.info.in:
    - Add "Trusty Thar"
  * debian/control:
    - Set Standards-Version to 3.9.4

  [ Jeremy Bicha ]
  * data/templates/Ubuntu.info.in: add 'devel' series (Closes: #722961)

  [ Jakub Wilk ]
  * python-apt: formatting error in library/index.rst (Closes: #692484)

  [ Daniel Hartwig ]
  * apt/package.py:
    - mark_upgrade misuses FromUser to set auto-installed (Closes: #686726)

 -- Julian Andres Klode <email address hidden> Mon, 21 Oct 2013 20:53:17 +0200

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

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