sources line is modified if a complete apt line is given

Bug #900081 reported by Brian Murray
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
software-properties (Ubuntu)
Confirmed
High
Unassigned

Bug Description

I was trying to add the oneiric-proposed pocket to my /etc/apt/sources.list with add-apt-repository instead of using vi. I was using the following command:

sudo apt-add-repository "http://archive.ubuntu.com/ubuntu/ oneiric-proposed main universe"

and the following line appeared in my sources.list

deb http://archive.ubuntu.com/ubuntu/ oneiric oneiric-proposed main universe
deb-src http://archive.ubuntu.com/ubuntu/ oneiric oneiric-proposed main universe

Notice that oneiric was added before oneiric-proposed. The documentation for add-apt-repository indicates that:

<sourceline> - The apt repository source line to add. This is one of:
   a complete apt line in quotes,

I did provide a complete apt line and it was modified by apt-add-repository and now I can't run 'apt-get updates'.

ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: python-software-properties 0.81.13.1
ProcVersionSignature: Ubuntu 3.0.0-13.22-generic 3.0.6
Uname: Linux 3.0.0-13-generic x86_64
ApportVersion: 1.23-0ubuntu4
Architecture: amd64
CheckboxSubmission: 2e6ecd139611830c78226ad04ff4c093
CheckboxSystem: bb422ca46d02494cdbc459927a98bc2f
Date: Sun Dec 4 16:10:50 2011
EcryptfsInUse: Yes
InstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Release amd64 (20101007)
PackageArchitecture: all
ProcEnviron:
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: software-properties
UpgradeStatus: Upgraded to oneiric on 2011-09-29 (66 days ago)

Revision history for this message
Brian Murray (brian-murray) wrote :
Changed in software-properties (Ubuntu):
importance: Undecided → High
Revision history for this message
Nick Russo (narusso-u) wrote :

A "complete apt line in quotes" requires a type at the beginning, (deb, deb-src, rpm, or rpm-src). If you add "deb " to your example, it will work as you expect. Without a type, it matches this argument type: "a repo url and areas in quotes (areas defaults to 'main')" so oneiric-proposed is assumed to be an area.

Revision history for this message
Robert Roth (evfool) wrote :

@Brian Murray: How would you like apt-add-repository to behave in this case? I tend to agree with Nick Russo, you have not specified a complete apt line in quotes, thus apt-add-repository is behaving as it should and as it is described with the --help option.
---
Ubuntu Bug Squad volunteer triager
http://wiki.ubuntu.com/BugSquad

Changed in software-properties (Ubuntu):
status: New → Incomplete
assignee: nobody → Robert Roth (evfool)
Revision history for this message
Brian Murray (brian-murray) wrote :

I believe that apt-add-repository broke my sources.list file by adding in 'oneiric' instead of using 'oneiric-proposed' as I said. I think it should either add 'deb' and 'deb-src' for me or error out.

Revision history for this message
Nick Russo (narusso-u) wrote :

I can only see two resolutions that might satisfy Brian's request:

1) teach apt-add-repository to differentiate between areas and distro names,
2) remove the 2nd sourceline variant described in the documentation.

The 2nd option would break valid existing scripts that use this tool.

The 1st option requires a database of all valid areas and distro names, which seems infeasible.

Robert Roth (evfool)
Changed in software-properties (Ubuntu):
status: Incomplete → Confirmed
assignee: Robert Roth (evfool) → nobody
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.