migrationitem: apply some fixes to the version-derivation code

The major change is reversing the order of three-part item names (i.e.
binNMUs with version information included) to use the more traditional
ordering of <src>/<arch>/<ver>.

Even if an instance is marked as versionned, passing a non-versionned
source package name should not cause a traceback.

Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
master
Adam D. Barratt 13 years ago
parent 02a9aa14ef
commit 41c72a3644

@ -37,12 +37,13 @@ class MigrationItem:
self._package, self._suite = package.split('_', 2)
else:
self._package, self._suite = (package, 'unstable')
if self._versionned:
self._version = parts[1]
if self._versionned and len(parts) > 1:
if len(parts) == 3:
self._architecture = parts[2]
self._architecture = parts[1]
self._version = parts[2]
else:
self._architecture = 'source'
self._version = parts[1]
else:
if len(parts) == 2:
self._architecture = parts[1]

Loading…
Cancel
Save