mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-05-10 00:11:29 +00:00
ubuntutools/misc: define POCKETS and DEFAULT_POCKETS
POCKETS is all valid pockets (capitalized), DEFAULT_POCKETS is all in POCKETS except 'Backports'.
This commit is contained in:
parent
b5ae0bdca3
commit
d0aa64a51b
@ -32,6 +32,9 @@ import distro_info
|
|||||||
|
|
||||||
from ubuntutools.lp.udtexceptions import PocketDoesNotExistError
|
from ubuntutools.lp.udtexceptions import PocketDoesNotExistError
|
||||||
|
|
||||||
|
DEFAULT_POCKETS = ('Release', 'Security', 'Updates', 'Proposed')
|
||||||
|
POCKETS = DEFAULT_POCKETS + ('Backports',)
|
||||||
|
|
||||||
_system_distribution_chain = []
|
_system_distribution_chain = []
|
||||||
|
|
||||||
|
|
||||||
@ -141,7 +144,7 @@ def split_release_pocket(release, default='Release'):
|
|||||||
(release, pocket) = release.rsplit('-', 1)
|
(release, pocket) = release.rsplit('-', 1)
|
||||||
pocket = pocket.capitalize()
|
pocket = pocket.capitalize()
|
||||||
|
|
||||||
if pocket not in ('Release', 'Security', 'Updates', 'Proposed', 'Backports'):
|
if pocket not in POCKETS:
|
||||||
raise PocketDoesNotExistError("Pocket '%s' does not exist." % pocket)
|
raise PocketDoesNotExistError("Pocket '%s' does not exist." % pocket)
|
||||||
|
|
||||||
return (release, pocket)
|
return (release, pocket)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user