mirror of
https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
synced 2025-03-23 17:01:11 +00:00
MigrationItem: canonicalise item names on output
Although multiple formats of item name are accepted (e.g. $pkg_$suite/$arch and $pkg/$arch_$suite), for compatibility and ease of parsing by clients the output format is standardised. Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
This commit is contained in:
parent
06410e37bd
commit
31651fafd7
@ -78,14 +78,17 @@ 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])
|
||||
parts = self._name.split('/', 3)
|
||||
if len(parts) == 1 or self._architecture == 'source':
|
||||
self._uvname = self._package
|
||||
else:
|
||||
self._uvname = self._name
|
||||
self._uvname = "%s/%s" % (self._package, self._architecture)
|
||||
if self._suite not in ('testing', 'unstable'):
|
||||
self._uvname = '%s_%s' % (self._uvname, self._suite)
|
||||
if self._versionned:
|
||||
self._name = '%s/%s' % (self._uvname, self._version)
|
||||
else:
|
||||
self._name = self._uvname
|
||||
|
||||
name = property(_get_name, _set_name)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user