517 Commits

Author SHA1 Message Date
Adam D. Barratt
e68e1b0451 Use the correct (and existing) variable in an error message
Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2011-10-29 14:32:26 +00:00
Adam D. Barratt
f2eb888a2b Drop some unused imports
Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2011-10-29 14:31:38 +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
79b243ef6a Merge branch 'master' into p-u 2011-10-28 17:37:26 +00:00
Adam D. Barratt
f4c3683ae7 Don't try to call __log on a non-existent class
Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2011-10-27 20:50:12 +00:00
Adam D. Barratt
3d6432d545 Drop unused import
Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2011-10-27 20:48:12 +00:00
Adam D. Barratt
4581ecd8d9 Fix-up a broken merge so smooth updates work again
Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2011-10-22 19:58:07 +00:00
Adam D. Barratt
9dc773b076 Merge branch 'master' into p-u
Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2011-10-22 19:48:55 +00:00
Adam D. Barratt
bbfaba859e When auto-hinting, also try a "minimal" package set
The minimal set is comprised of only the first level of (reverse)
dependencies, before any further iterations of packages are added to
the set.  In some cases, the result of the full iteration will contain
packages which cause problems when migrated but the minimal set,
although possibly a less optimal solution, may be able to migrate
successfully.

It is assumed that migrating the larger set of packages will be
preferred if possible, so minimal sets are tried later.

Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2011-10-22 19:46:09 +00:00
Adam D. Barratt
be28f670a5 Don't consider intra-source dependencies for smooth updates
Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2011-10-22 19:41:51 +00:00
Adam D. Barratt
f4c306e0e9 Remove an unused variable
(part of 22a9427c21b6216e093252ba77e09d5f10e436f7 from master)

Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2011-10-22 19:38:26 +00:00
Niels Thykier
79f24cd38f Removed two unused methods, check_installable and check_conflicts 2011-10-22 19:37:13 +00:00
Niels Thykier
22d8167786 Allow a list as well as a tuple in Britney.do_hint 2011-10-22 19:30:00 +00:00
Adam D. Barratt
c47e08b8cf Fix up broken logic so that binary removals work again
Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2011-10-22 19:28:09 +00:00
Adam D. Barratt
513a6ff453 smooth updates: pass a list of MigrationItems to remove, not strings
Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2011-10-22 19:26:57 +00:00
Adam D. Barratt
2e51db80c9 Make sort_actions support MigrationItems
Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2011-10-22 19:25:43 +00:00
Adam D. Barratt
49cbd35310 Fix up the addition of "unblock" hints for t-p-u approvals.
Thanks to Niels Thykier for the original idea.

Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2011-10-22 14:47:00 +00:00
Niels Thykier
ced28100fb Fixed tab-completion for packages containing "-"
Also fix broken tab-completion after the first "/".
2011-10-22 14:09:35 +02:00
Niels Thykier
27ddc8a9e7 Fixed weird whitespace in the end of completer.py 2011-10-22 13:43:06 +02:00
Niels Thykier
7343b84288 Added package completion to the readline completor 2011-10-22 13:42:14 +02:00
Niels Thykier
dda7031ea3 Do not crash if writing histfile fails with --hint-tester
It does not affect the result and only means the user does not
have any readline-history.
2011-10-22 10:26:10 +02:00
Mehdi Dogguy
a687b00e18 Typo fix 2011-10-19 20:02:29 +00:00
Adam D. Barratt
dcad3f3480 When auto-hinting, also try a "minimal" package set
The minimal set is comprised of only the first level of (reverse)
dependencies, before any further iterations of packages are added to
the set.  In some cases, the result of the full iteration will contain
packages which cause problems when migrated but the minimal set,
although possibly a less optimal solution, may be able to migrate
successfully.

It is assumed that migrating the larger set of packages will be
preferred if possible, so minimal sets are tried later.

Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2011-10-19 18:23:52 +00:00
Niels Thykier
cf080e49bd Reduced Britney.parser to a local variable
Britney.parser was not used outside __parse_arguments, so there
is little use in keeping it alive as an instance variable.
2011-10-19 12:14:02 +02:00
Niels Thykier
33a10f6f35 Fixed some weird indentations 2011-10-19 11:49:25 +02:00
Niels Thykier
1103ee2e61 Removed some unused local variables and arguments 2011-10-19 11:40:11 +02:00
Niels Thykier
77c36ca7cb Removed two unused methods, check_installable and check_conflicts 2011-10-19 11:30:45 +02:00
Niels Thykier
b6ca8d4842 Clarified how britney is compiled 2011-10-19 10:35:10 +02:00
Mehdi Dogguy
ea496a3b48 Remove obsolete files 2011-10-18 20:28:08 +00:00
Julien Cristau
04f3dd1d94 Typo fix 2011-10-16 19:39:24 +02:00
Adam D. Barratt
8268ab61a7 Don't consider intra-source dependencies for smooth updates
Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2011-10-13 20:22:33 +00:00
Adam D. Barratt
04a7bc6bb2 hints: rename the "hints" method to the more helpful "search".
Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2011-09-04 20:26:36 +00:00
Adam D. Barratt
6b953d8f9e Migrate "packages[0]"-style code to the package and version properties.
Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2011-09-04 19:46:38 +00:00
Adam D. Barratt
7e324daa56 A failed unblock hint should list that hint's user, not the block's
Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2011-09-04 19:00:59 +00:00
Adam D. Barratt
4276dbe347 hints: support package and version properties.
Each property returns the value of the corresponding property for the first
entry in the package list; this is a handy short-cut for hints where there
will only ever be one package in the list (e.g. "age-days", "unblock").

Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2011-09-04 18:58:14 +00:00
Adam D. Barratt
0af34d1629 Fix some brown paper bag bugs in the hint parsing code.
Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2011-09-04 18:24:54 +00:00
Adam D. Barratt
483f2c502c hints: allow hints to be stringified
Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2011-09-04 18:24:26 +00:00
Adam D. Barratt
a1838a5037 hints: fix up hint parsing code for age-days
string.split()'s second argument specifies the maximum number of times
the string should be split, not the maximum number of elements in the
result.

Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2011-09-04 17:05:35 +00:00
Adam D. Barratt
0971adec29 Move hint-using code to using HintCollection and HintItem
In order to make a number of the changes required for the migration simpler,
we also complete the previous migration to using {Hint,Migration}Item rather
than passing around strings representing packages and converting between
the two forms in several places.

Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2011-09-04 16:41:33 +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
6c09b55a84 hints: allow more properties to be used for filtering the hint list
Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2011-09-04 16:23:06 +00:00
Adam D. Barratt
4b395f79ad hints: export the user associated with a hint via a property
Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2011-09-04 16:21:10 +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
af93264815 Add initial version of Hint/HintCollection classes.
These classes encapsulate information about individual hints, with
HintCollection providing a convenient wrapper around a set of hints.

Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2011-09-01 18:15:34 +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
9c7fcbc42c Migrate most code parsing package names to use MigrationItems.
The use of MigrationItem allows us to centralise the parsing and splitting of
package names and architectures, avoiding duplication and simplifying a
number of conditions.

Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2011-08-31 19:55:22 +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
Adam D. Barratt
d10630ff56 Grammar / spelling fix some comments
Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2011-08-28 21:45:14 +00:00