add-apt-repository error is not clear

Bug #1178015 reported by Scott Kostyshak on 2013-05-08
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
software-properties (Ubuntu)
Low
Barry Warsaw

Bug Description

If two repositories are given as an argument, the error is:
"Error: need a repository as argument"

I think that add-apt-repository should support multiple repositories. But if not, the error should be changed to:
"Error: need a single repository as argument"

Attached is a patch.

Scott

The attachment "apt-add-repository.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Brian Murray (brian-murray) wrote :

Thanks, for your work on this, but I wonder if the error message is really clear if you provide no repositories. Perhaps there should be a case for no repositories and one for more than one?

Changed in software-properties (Ubuntu):
status: New → Triaged
importance: Undecided → Low

Good point. Attached is a new patch. It might violate some style rules. I find 'elif' more readable here but some may prefer 'if'. Also, "!= 1" could be used instead of "> 1" but I find "> 1" more readable.

Scott

Barry Warsaw (barry) wrote :

Nice patch, I'll apply it (ignoring the icky Python style issues which aren't your fault :)

Changed in software-properties (Ubuntu):
assignee: nobody → Barry Warsaw (barry)
Barry Warsaw (barry) wrote :

Style issues: meaning the unnecessary parens in the conditionals. I'll clean up a few of these after applying your patch.

Barry Warsaw (barry) wrote :

The patch doesn't apply cleanly against lp:software-properties, but it's easy enough to adapt.

Thanks Barry!

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package software-properties - 0.92.19

---------------
software-properties (0.92.19) saucy; urgency=low

  [ Scott Kostyshak ]
  * Improve error message when more than one repository argument is
    given. (LP: #1178015)
 -- Barry Warsaw <email address hidden> Tue, 28 May 2013 15:50:02 -0400

Changed in software-properties (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers