mirror of
https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
synced 2025-06-03 22:01:35 +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
af93264815
commit
5af1de9ba2
@ -56,6 +56,15 @@ class MigrationItem:
|
|||||||
if self.is_removal:
|
if self.is_removal:
|
||||||
self._suite = 'testing'
|
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)
|
name = property(_get_name, _set_name)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -78,6 +87,10 @@ class MigrationItem:
|
|||||||
def version(self):
|
def version(self):
|
||||||
return self._version
|
return self._version
|
||||||
|
|
||||||
|
@property
|
||||||
|
def uvname(self):
|
||||||
|
return self._uvname
|
||||||
|
|
||||||
class HintItem(MigrationItem):
|
class HintItem(MigrationItem):
|
||||||
def __init__(self, name = None):
|
def __init__(self, name = None):
|
||||||
MigrationItem.__init__(self, name = name, versionned = True)
|
MigrationItem.__init__(self, name = name, versionned = True)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user