mirror of
https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
synced 2025-03-26 10:21:12 +00:00
MigrationItem: support "$pkg/$ver/$arch" syntax
This relies on the caller supplying a list of valid architectures, and assumes that none of the list entries are also valid version strings. Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
This commit is contained in:
parent
92eca3958c
commit
60b682a4c3
@ -13,6 +13,16 @@
|
||||
# GNU General Public License for more details.
|
||||
|
||||
class MigrationItem:
|
||||
_architectures = []
|
||||
|
||||
@classmethod
|
||||
def set_architectures(cls, architectures = None):
|
||||
cls._architectures = architectures or []
|
||||
|
||||
@classmethod
|
||||
def get_architectures(cls):
|
||||
return cls._architectures
|
||||
|
||||
def __init__(self, name = None, versionned = False):
|
||||
self._name = None
|
||||
self._uvname = None
|
||||
@ -71,6 +81,10 @@ class MigrationItem:
|
||||
else:
|
||||
self._architecture = 'source'
|
||||
|
||||
if self._version in self.__class__.get_architectures():
|
||||
(self._architecture, self._version) = \
|
||||
(self._version, self._architecture)
|
||||
|
||||
if '_' in self._architecture:
|
||||
self._architecture, self._suite = \
|
||||
self._architecture.split('_', 2)
|
||||
|
Loading…
x
Reference in New Issue
Block a user