mirror of
https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
synced 2025-02-15 16:28:20 +00:00
Move old_libraries_format to britney_util
Signed-off-by: Niels Thykier <niels@thykier.net>
This commit is contained in:
parent
568d5f809c
commit
5026e9ee6e
18
britney.py
18
britney.py
@ -212,7 +212,7 @@ from excuse import Excuse
|
|||||||
from migrationitem import MigrationItem, HintItem
|
from migrationitem import MigrationItem, HintItem
|
||||||
from hints import HintCollection
|
from hints import HintCollection
|
||||||
from britney import buildSystem
|
from britney import buildSystem
|
||||||
from britney_util import same_source, undo_changes
|
from britney_util import old_libraries_format, same_source, undo_changes
|
||||||
from consts import (VERSION, SECTION, BINARIES, MAINTAINER, FAKESRC,
|
from consts import (VERSION, SECTION, BINARIES, MAINTAINER, FAKESRC,
|
||||||
SOURCE, SOURCEVER, ARCHITECTURE, DEPENDS, CONFLICTS,
|
SOURCE, SOURCEVER, ARCHITECTURE, DEPENDS, CONFLICTS,
|
||||||
PROVIDES, RDEPENDS, RCONFLICTS)
|
PROVIDES, RDEPENDS, RCONFLICTS)
|
||||||
@ -2431,14 +2431,14 @@ class Britney(object):
|
|||||||
removals = self.old_libraries()
|
removals = self.old_libraries()
|
||||||
if len(removals) > 0:
|
if len(removals) > 0:
|
||||||
self.output_write("Removing packages left in testing for smooth updates (%d):\n%s" % \
|
self.output_write("Removing packages left in testing for smooth updates (%d):\n%s" % \
|
||||||
(len(removals), self.old_libraries_format(removals)))
|
(len(removals), old_libraries_format(removals)))
|
||||||
self.do_all(actions=[ MigrationItem(x) for x in removals ])
|
self.do_all(actions=[ MigrationItem(x) for x in removals ])
|
||||||
removals = self.old_libraries()
|
removals = self.old_libraries()
|
||||||
else:
|
else:
|
||||||
removals = ()
|
removals = ()
|
||||||
|
|
||||||
self.output_write("List of old libraries in testing (%d):\n%s" % \
|
self.output_write("List of old libraries in testing (%d):\n%s" % \
|
||||||
(len(removals), self.old_libraries_format(removals)))
|
(len(removals), old_libraries_format(removals)))
|
||||||
|
|
||||||
# output files
|
# output files
|
||||||
if not self.options.dry_run:
|
if not self.options.dry_run:
|
||||||
@ -2702,18 +2702,6 @@ class Britney(object):
|
|||||||
removals.append("-" + pkg_name + "/" + arch)
|
removals.append("-" + pkg_name + "/" + arch)
|
||||||
return removals
|
return removals
|
||||||
|
|
||||||
def old_libraries_format(self, libs):
|
|
||||||
"""Format old libraries in a smart table"""
|
|
||||||
libraries = {}
|
|
||||||
for i in libs:
|
|
||||||
pkg, arch = i.split("/")
|
|
||||||
pkg = pkg[1:]
|
|
||||||
if pkg in libraries:
|
|
||||||
libraries[pkg].append(arch)
|
|
||||||
else:
|
|
||||||
libraries[pkg] = [arch]
|
|
||||||
return "\n".join([" " + k + ": " + " ".join(libraries[k]) for k in libraries]) + "\n"
|
|
||||||
|
|
||||||
def nuninst_arch_report(self, nuninst, arch):
|
def nuninst_arch_report(self, nuninst, arch):
|
||||||
"""Print a report of uninstallable packages for one architecture."""
|
"""Print a report of uninstallable packages for one architecture."""
|
||||||
all = {}
|
all = {}
|
||||||
|
@ -113,3 +113,17 @@ def undo_changes(lundo, systems, sources, binaries,
|
|||||||
del binaries['testing'][arch][1][j[1:]]
|
del binaries['testing'][arch][1][j[1:]]
|
||||||
else:
|
else:
|
||||||
binaries['testing'][arch][1][j] = undo['virtual'][p]
|
binaries['testing'][arch][1][j] = undo['virtual'][p]
|
||||||
|
|
||||||
|
|
||||||
|
def old_libraries_format(libs):
|
||||||
|
"""Format old libraries in a smart table"""
|
||||||
|
libraries = {}
|
||||||
|
for i in libs:
|
||||||
|
pkg, arch = i.split("/")
|
||||||
|
pkg = pkg[1:]
|
||||||
|
if pkg in libraries:
|
||||||
|
libraries[pkg].append(arch)
|
||||||
|
else:
|
||||||
|
libraries[pkg] = [arch]
|
||||||
|
return "\n".join(" " + k + ": " + " ".join(libraries[k]) for k in libraries) + "\n"
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user