mirror of
https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
synced 2025-02-13 15:37:02 +00:00
Make obsolete source package removal slightly more intelligent
Previously a package which became obsolete during a run would not be automatically removed until the next run. This was due to the fact that sources[][BINARIES] is not updated during the run. Instead, we build a list of source packages which produce at least one binary and then remove any packages not in that list. Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
This commit is contained in:
parent
998d6ee2bc
commit
d11c40d4b8
15
britney.py
15
britney.py
@ -2417,12 +2417,21 @@ class Britney(object):
|
||||
# run the auto hinter
|
||||
self.auto_hinter()
|
||||
|
||||
# obsolete source packages
|
||||
# obsolete source packages
|
||||
# a package is obsolete if none of the binary packages in testing
|
||||
# are built by it
|
||||
self.__log("> Removing obsolete source packages from testing", type="I")
|
||||
removals = []
|
||||
# local copies for performance
|
||||
sources = self.sources['testing']
|
||||
removals = [ HintItem("-%s/%s" % (source, sources[source][VERSION])) for \
|
||||
source in sources if len(sources[source][BINARIES]) == 0 ]
|
||||
binaries = self.binaries['testing']
|
||||
used = set(binaries[arch][0][binary][SOURCE]
|
||||
for arch in binaries
|
||||
for binary in binaries[arch][0]
|
||||
)
|
||||
removals = [ HintItem("-%s/%s" % (source, sources[source][VERSION]))
|
||||
for source in sources if source not in used
|
||||
]
|
||||
if len(removals) > 0:
|
||||
self.output_write("Removing obsolete source packages from testing (%d):\n" % (len(removals)))
|
||||
self.do_all(actions=removals)
|
||||
|
Loading…
x
Reference in New Issue
Block a user