508 Commits

Author SHA1 Message Date
Adam D. Barratt
629c80937d britney_util: add make_hintitem()
This function allows a textual representation of a package (e.g.
"foo/amd64") to be convered to a HintItem().

Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2013-09-07 16:57:35 +00:00
Niels Thykier
09e9e16431 Reduce the number of "used-once" lists
Where possible, avoid creating a list only to discard immediately
afterwards.  Example:

"""
  for x in sorted([x for x in ...]):
      ...
"""

Creates a list, passes it to sorted, which generates a new list and
sorts that copy.  Since sorted accepts an iterable, we can avoid the
"inner" list and just pass it a generator expression instead.

Signed-off-by: Niels Thykier <niels@thykier.net>
2013-08-11 15:23:45 +02:00
Niels Thykier
c554bffee4 Move newlyuninst to britney_util
Also, renamed it for consistency with the other X_uninst functions.

Signed-off-by: Niels Thykier <niels@thykier.net>
2013-07-10 20:01:04 +02:00
Niels Thykier
8c911748c8 Move eval_uninst to britney_util
Signed-off-by: Niels Thykier <niels@thykier.net>
2013-07-10 20:01:04 +02:00
Niels Thykier
a2d63aed07 Move write_heidi to britney_util
Signed-off-by: Niels Thykier <niels@thykier.net>
2013-07-10 20:01:04 +02:00
Niels Thykier
82771fb4ee Move {read,write}_nuninst to britney_util
Signed-off-by: Niels Thykier <niels@thykier.net>
2013-07-10 20:01:04 +02:00
Niels Thykier
d959541722 Move get_reverse_tree into britney_util
Rename get_reverse_tree and move it to britney_util with slightly
different arguments.

Signed-off-by: Niels Thykier <niels@thykier.net>
2013-07-10 20:01:04 +02:00
Niels Thykier
c34cdddded register_reverses: factor out a[0]
Signed-off-by: Niels Thykier <niels@thykier.net>
2013-07-10 20:01:04 +02:00
Niels Thykier
d3401d4829 Move the package loop into register_reverses
By moving the package loop inside register_reverses, it will be
invoked a lot less (reducing the overhead of invoking functions).

Signed-off-by: Niels Thykier <niels@thykier.net>
2013-07-10 20:01:04 +02:00
Niels Thykier
9dc6d1415e Move register_reverses to britney_util
Signed-off-by: Niels Thykier <niels@thykier.net>
2013-07-10 20:01:04 +02:00
Niels Thykier
88e8ff6005 Add container filters and use it to refactor get_reverse_tree
Signed-off-by: Niels Thykier <niels@thykier.net>
2013-07-10 20:01:04 +02:00
Niels Thykier
11fab49365 Merge get_reverse_tree and get_full_tree
Beside some "minor differences" they were computing the same "tree"
(read: "graph"), so merge them into one (get_reverse_tree) and
properly document return value and special cases.

Signed-off-by: Niels Thykier <niels@thykier.net>
2013-07-10 20:01:03 +02:00
Niels Thykier
5026e9ee6e Move old_libraries_format to britney_util
Signed-off-by: Niels Thykier <niels@thykier.net>
2013-07-10 20:01:03 +02:00
Niels Thykier
568d5f809c Move "undo_changes" to britney_util
Signed-off-by: Niels Thykier <niels@thykier.net>
2013-07-10 20:01:03 +02:00
Niels Thykier
df47518dae Move "constants" to a new consts module
Signed-off-by: Niels Thykier <niels@thykier.net>
2013-07-10 20:01:03 +02:00
Niels Thykier
9e14cb520c Move same_source to separate module
Signed-off-by: Niels Thykier <niels@thykier.net>
2013-07-10 20:01:03 +02:00
Niels Thykier
b505a5a357 Remove unused write_bugs
The method was last invoked in 2008 (commit 3dc3be1c7).

Signed-off-by: Niels Thykier <niels@thykier.net>
2013-07-10 20:01:03 +02:00
Niels Thykier
1942e00ee1 britney: Do not consider "smooth-updates-only" interesting
Signed-off-by: Niels Thykier <niels@thykier.net>
2013-07-09 18:11:22 +02:00
Niels Thykier
2477033786 britney: Refactor arguments of method
Rewrite the arguments of find_upgraded_binaries to not use an instance
of MigrationItem.  We want to call it at a time where we have not
created MigrationItems yet.

Signed-off-by: Niels Thykier <niels@thykier.net>
2013-07-09 18:11:22 +02:00
Niels Thykier
3df18bcd53 britney: Refactor a part of doop_source into its own method
Signed-off-by: Niels Thykier <niels@thykier.net>
2013-07-09 18:02:55 +02:00
Niels Thykier
14cefe379e INSTALL: Update package list to use python2.7
Signed-off-by: Niels Thykier <niels@thykier.net>
2013-07-07 15:47:04 +02:00
Niels Thykier
1641706305 Migrate to python2.7
Signed-off-by: Niels Thykier <niels@thykier.net>
2013-07-07 15:37:15 +02:00
Adam D. Barratt
527d7f03e6 Remove two "the the"s
Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2013-07-06 12:42:52 +00:00
Adam D. Barratt
141d62cca1 Correct a thinko in a comment in should_upgrade_srcarch()
A removal hint will generate both source and per-arch excuses if the
version of the source package differs between testing and unstable. If
the source versions are the same then only the per-arch excuses will
be generated.

Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2013-07-06 11:26:11 +00:00
Adam D. Barratt
6d8aec3a6a Improve comments in should_upgrade_srcarch()
Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2013-07-06 11:21:53 +00:00
Colin Watson
33d905fc3a Apply undo list in reverse order.
In rare cases with hints with overlapping virtual packages provided by
different sources, this can make a difference.

Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2013-07-05 18:06:40 +00:00
Colin Watson
e99ea14601 Don't crash on unversioned unblock hints.
Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2013-07-05 18:04:33 +00:00
Adam D. Barratt
84bad954ad Only record a package once in the source->binary package mapping
If there are multiple versions of an arch:all package in unstable (due
to outdated or no longer built arch:any packages) then only one of them
should be recorded in the list of binary packages built from the source
package. Otherwise we may try and remove the binary package from various
lists multiple times, leading to crashes.

Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2013-07-01 18:13:51 +00:00
Adam D. Barratt
9ee37c5160 Enable support for p-u packages
Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2013-06-12 19:39:27 +00:00
Adam D. Barratt
a58f6d72c9 Ensure that binNMUs from superseded sources are not considered
Given a source which provides two packages and has different versions
in testing and unstable, binNMUs in unstable corresponding to the
older source version should not be considered as migration candidates.

For example:

testing
-------

source 1
bin 1 arch1
bin 1 arch2

unstable
--------

source 2
bin 2 arch1
bin 1+b1 arch2

The binary migration on arch2 should not be considered a candidate.

Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2013-06-08 15:40:07 +00:00
Adam D. Barratt
c7f27a8225 Re-enable smooth-updates
Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2013-05-05 11:09:37 +00:00
Adam D. Barratt
858e8de218 same_source: handle being passed "None" as a version
Although this should never happen, rather than crashing if one of the
versions is none, simply indicate that they are unequal.

Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2013-03-17 10:33:59 +00:00
Adam D. Barratt
7933a720aa Completer: add "approve" to the command completion
Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2013-03-16 17:19:49 +00:00
Adam D. Barratt
ce72b31bc6 Completer: offer tpu packages when completing "approve" hints
Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2013-03-16 17:19:01 +00:00
Adam D. Barratt
af86002dea Completer: copyright foo
Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2013-03-16 17:12:04 +00:00
Adam D. Barratt
c345dea3b5 Completer: when processing a "remove", only offer packages from testing
Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2013-03-16 17:10:11 +00:00
Adam D. Barratt
de56c719b6 Completer: add forgotten "remove" to command completion
Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2013-03-16 16:59:19 +00:00
Adam D. Barratt
d9a9a26c57 Completer: support all hints
Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2013-03-16 16:39:23 +00:00
Adam D. Barratt
0463c666f0 write_excuses: clear the list of excuses before building
Although this isn't an issue during normal runs, the excuses might be
built multiple times during a hint-tester run and should not accumulate
during the run.

Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2013-03-16 16:31:04 +00:00
Adam D. Barratt
33bc6cb7fb hint_tester: accept all hints
For those hints which don't cause an immediate run (i.e. other than
easy, hint and force-hint), re-build the excuses after adding the
hint so that the actions are accounted for in later hints.

Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2013-03-16 16:30:18 +00:00
Adam D. Barratt
8e72456651 Completer: don't crash if there are candidates in t-p-u
Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2013-03-14 19:58:14 +00:00
Adam D. Barratt
8c15568b8f Don't remove arch:all packages when migrating binNMUs via *pu
A binNMU does not rebuild architecture:all packages. For migrations via
unstable this is not a problem as the packages corresponding to the
source upload are still present. However, for *pu migrations, the set of
packages considered only includes architecture-specific packages. In
order to avoid installability issues with packages in testing which
depend on the arch:all packages, we leave the existing arch:all packages
in testing and only consider the arch-specific packages for migration.

Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2013-03-03 17:23:38 +00:00
Adam D. Barratt
2a590ff095 Replace a single-use list in the smooth updates checks with any()
Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2013-02-06 19:56:04 +00:00
Adam D. Barratt
acec4ff6e3 Use any() in tpu o-o-d checks rather than throwaway lists
The test only needs to consider whether any binaries exist on a given
arch, not how many of them there are (or indeed which binaries they are)

Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2013-02-06 19:09:04 +00:00
Adam D. Barratt
25cc2c3b36 Split the tpu o-o-d checks up to make them more readable
Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2013-02-06 19:05:16 +00:00
Adam D. Barratt
9f4af0171e Fix tpu out-of-date checks for sources with multiple versions in tpu
When checking whether a tpu source has built on a particular arch, we
should only consider binaries produced by the latest version of the
source package in tpu.

Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2013-02-06 17:18:46 +00:00
Adam D. Barratt
74d1b70096 Don't flag unbuilt binary *pu binNMUs for removal in excuses
Originally when binNMUs for packages in testing were scheduled, the
binaries would be installed into tpu with no accompanying source. This
allowed the "removed binary" portions of should_upgrade_srcarch() to be
skipped (as britney had generated a faux source record).

dak now adds the source package to tpu in such cases which lead to the
"removed binary" checks being applied to binNMUs in tpu with potentially
destructive consequences. For example, if a package with amd64 and i386
binaries in testing were binNMUed on just amd64, britney would notice
that there were no i386 binaries in tpu and subsequently remove the i386
binaries from testing as well.

In order to resolve this, we skip the check for removed binaries when
building excuses for a binary-only migration via *pu.

Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2013-02-02 22:47:56 +00:00
Adam D. Barratt
cf79fe5618 Add jmw
Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2013-01-22 13:02:13 +00:00
Adam D. Barratt
67a181d8fc Merge excuses "unblock" parsing for unstable and *pu
The primary difference between the parsing / output of excuses for *pu
and unstable unblocks is the messages displayed. We can therefore remove
some duplication by having the same code handle both, outputting the
appropriate message.

Where a *pu package is also the subject of a "block" (most likely during
a freeze) we only supply the "needs approval" or "approved" message;
previously both "needs approval" and "not touching due to block" were
output, which is redundant. We ensure that there is always a dummy
"block" hint for *pu packages to provide the "needs approval" behaviour.

Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2013-01-18 18:52:07 +00:00
Adam D. Barratt
83f25ca602 Remove remaining "approve" hint support code
Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2013-01-18 18:47:06 +00:00