19 Commits

Author SHA1 Message Date
Adam D. Barratt
2031288ead MigrationItem: use Python 2.6 property decorators for name / suite
Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2011-11-27 18:18:53 +00:00
Adam D. Barratt
56afba5d4b MigrationItem: make the "suite" property read/write
Changing the suite requires update the item's canonical names, as these
need to reflect the new suite.

The property() function only applies to new-style classes, so we also
need to update MigrationItem to be new-style.

Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2011-11-15 20:45:51 +00:00
Adam D. Barratt
b635769606 MigrationItem: rename _build_name() to _canonicalise_name()
Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2011-11-15 20:15:49 +00:00
Adam D. Barratt
994097e0fb MigrationItem: separate item name parsing from canonicalisation
This allows us to re-canonicalise the item's name if any of the item's
properties are altered without updating its name.

Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2011-11-15 20:13:03 +00:00
Adam D. Barratt
111d6b791a Syntax tweak
Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2011-11-14 18:28:32 +00:00
Adam D. Barratt
6672c96db3 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>
2011-11-11 13:28:04 +00:00
Adam D. Barratt
c19f880142 Fix up spacing issues; thanks Niels.
Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2011-11-10 10:30:13 +00:00
Adam D. Barratt
bdba8dfbde MigrationItem: fix name output for removal items
Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2011-11-09 23:31:56 +00:00
Adam D. Barratt
31651fafd7 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>
2011-11-09 23:24:42 +00:00
Adam D. Barratt
06410e37bd Correctly parse foo/arch/ver in unversionned mode
Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2011-11-09 22:44:55 +00:00
Adam D. Barratt
9e2f0af8d4 Ensure _package and _uvname attributes are always defined
Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2011-10-29 17:17:42 +00:00
Adam D. Barratt
e9d0971e49 Fix odd spacing
Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2011-10-29 17:14:00 +00:00
Adam D. Barratt
45464070d7 MigrationItem: fix typo in parsing of some *-p-u versions
Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2011-10-29 14:30:43 +00:00
Adam D. Barratt
70e44c3a0f migrationitem: add support for using items as indexes in to lists
In order to provide the support, items may now be tested for equality
and hashed.  Two items are considered equal if they have the same
unversioned name (and version, if appropriate); hashing is based on
a tuple hash of the name and version.

Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2011-09-04 16:36:40 +00:00
Adam D. Barratt
860bd8069c migrationitem: allow instances to be stringified
Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2011-09-04 16:34:58 +00:00
Adam D. Barratt
149782ad84 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>
2011-09-04 16:17:39 +00:00
Adam D. Barratt
5af1de9ba2 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>
2011-09-04 16:15:03 +00:00
Adam D. Barratt
59f789a300 migrationitem: allow for the specification of version information.
The new convenience HintItem class automatically sets the "this item contains
version information" flag when creating a new item.

Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2011-08-31 20:07:35 +00:00
Adam D. Barratt
bff3139b3a MigrationItem: new class representing a single package being migrated.
Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2011-08-31 19:52:05 +00:00