Add support for private PPAs

Bug #1632887 reported by Haw Loeung
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Charm Helpers
New
Undecided
Unassigned

Bug Description

Hi,

At present, the apt fetch.add_sources() uses 'add-apt-repository' to add defined install_sources. Unfortunately, for private PPAs, this causes issues with multiple sources added to /etc/apt/sources.list (especially on change of key):

...
| # deb http://archive.canonical.com/ubuntu xenial partner
| # deb-src http://archive.canonical.com/ubuntu xenial partner
|
| deb https://prodstack-cdo:<email address hidden>/canonical-xxx-service/canonical-xxx-health/ubuntu xenial main
| deb https://prodstack-cdo:<email address hidden>/canonical-somedude/XXX-health/ubuntu xenial main
| deb https://prodstack-cdo:<email address hidden>/canonical-XXX-service/canonical-xxx-health/ubuntu xenial main

As per the add-apt-repository man page[1], it says if you use the repository string ppa:... it will add the source to /etc/apt/sources.d but unfortunately digging into the code, it doesn't support private PPAs:

software-properties-0.96.20.4/softwareproperties/ppa.py:

| class PPAShortcutHandler(object):
| def __init__(self, shortcut):
| super(PPAShortcutHandler, self).__init__()
| try:
| self.shortcut = mangle_ppa_shortcut(shortcut)
| except:
| raise ShortcutException(_("ERROR: '{shortcut}' is not a valid ppa format")
| .format(shortcut=shortcut))
| info = get_ppa_info(self.shortcut)
|
| if "private" in info and info["private"]:
| raise ShortcutException(
| _("Adding private PPAs is not supported currently"))
|
| self._info = info

Any chance we could update fetch.add_sources() to handle private PPAs properly and ship them out to /etc/apt/sources.d like we're already doing for cloud: and proposed:?

[1]http://manpages.ubuntu.com/manpages/trusty/en/man1/add-apt-repository.1.html#contenttoc3

Tags: landscape
Haw Loeung (hloeung)
description: updated
tags: added: landscape
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.