mirror of
https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
synced 2025-03-10 10:51:08 +00:00
migrationitem: add an "unversioned name" property
This can be used to retrieve the version information from a versionned hint; for unversionned hints, it is effectively a synonym for "name". Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
This commit is contained in:
parent
0c2c672bb2
commit
02a9aa14ef
@ -56,6 +56,15 @@ class MigrationItem:
|
||||
if self.is_removal:
|
||||
self._suite = 'testing'
|
||||
|
||||
if self._versionned:
|
||||
parts = self._name.split('/', 3)
|
||||
if len(parts) == 1 or self._architecture == 'source':
|
||||
self._uvname = parts[0]
|
||||
else:
|
||||
self._uvname = "%s/%s" % (parts[0], parts[1])
|
||||
else:
|
||||
self._uvname = self._name
|
||||
|
||||
name = property(_get_name, _set_name)
|
||||
|
||||
@property
|
||||
@ -78,6 +87,10 @@ class MigrationItem:
|
||||
def version(self):
|
||||
return self._version
|
||||
|
||||
@property
|
||||
def uvname(self):
|
||||
return self._uvname
|
||||
|
||||
class HintItem(MigrationItem):
|
||||
def __init__(self, name = None):
|
||||
MigrationItem.__init__(self, name = name, versionned = True)
|
||||
|
Loading…
x
Reference in New Issue
Block a user