britney: Print the current package to stderr when AIEEEing.

Signed-off-by: Cyril Brulebois <kibi@debian.org>
debian
Cyril Brulebois 13 years ago
parent 3e9c1acb8e
commit 6e701a09cd

@ -2093,7 +2093,7 @@ class Britney(object):
nuninst_arch = None nuninst_arch = None
if not (skip_archall and binaries[arch][0][p][ARCHITECTURE] == 'all'): if not (skip_archall and binaries[arch][0][p][ARCHITECTURE] == 'all'):
nuninst_arch = nuninst[arch] nuninst_arch = nuninst[arch]
self._installability_test(systems[arch], p, broken, to_check, nuninst_arch) self._installability_test(systems[arch], p, broken, to_check, nuninst_arch, pkg)
# broken packages (second round, reverse dependencies of the first round) # broken packages (second round, reverse dependencies of the first round)
while to_check: while to_check:
@ -2105,7 +2105,7 @@ class Britney(object):
nuninst_arch = None nuninst_arch = None
if not (skip_archall and binaries[arch][0][p][ARCHITECTURE] == 'all'): if not (skip_archall and binaries[arch][0][p][ARCHITECTURE] == 'all'):
nuninst_arch = nuninst[arch] nuninst_arch = nuninst[arch]
self._installability_test(systems[arch], p, broken, to_check, nuninst_arch) self._installability_test(systems[arch], p, broken, to_check, nuninst_arch, pkg)
# if we are processing hints, go ahead # if we are processing hints, go ahead
if hint: if hint:
@ -2721,7 +2721,7 @@ class Britney(object):
self.__output.close() self.__output.close()
def _installability_test(self, system, p, broken, to_check, nuninst_arch): def _installability_test(self, system, p, broken, to_check, nuninst_arch, current_pkg):
"""Test for installability of a package on an architecture """Test for installability of a package on an architecture
p is the package to check and system does the actual check. p is the package to check and system does the actual check.
@ -2733,9 +2733,15 @@ class Britney(object):
If nuninst_arch is not None then it also updated in the same If nuninst_arch is not None then it also updated in the same
way as broken is. way as broken is.
current_pkg is the package currently being tried, mainly used
to print where an AIEEE is coming from.
""" """
r = system.is_installable(p) r = system.is_installable(p)
if not r: if r <= 0:
# AIEEE: print who's responsible for it
if r == -1:
sys.stderr.write("AIEEE triggered by: %s\n" % current_pkg)
# not installable # not installable
if p not in broken: if p not in broken:
broken.add(p) broken.add(p)

@ -46,9 +46,10 @@ static void dpkgpackages_dealloc(dpkgpackages *self) {
static PyObject *dpkgpackages_isinstallable(dpkgpackages *self, PyObject *args) static PyObject *dpkgpackages_isinstallable(dpkgpackages *self, PyObject *args)
{ {
char *pkgname; char *pkgname;
int r;
if (!PyArg_ParseTuple(args, "s", &pkgname)) return NULL; if (!PyArg_ParseTuple(args, "s", &pkgname)) return NULL;
if (checkinstallable2(self->pkgs, pkgname)) { if ((r=checkinstallable2(self->pkgs, pkgname))) {
return Py_BuildValue("i", 1); return Py_BuildValue("i", r);
} else { } else {
return Py_BuildValue(""); return Py_BuildValue("");
} }

@ -909,7 +909,8 @@ static int checkinstallable(dpkg_packages *pkgs, collpackagelist *instoneof) {
} }
fprintf(stderr, ".\n"); fprintf(stderr, ".\n");
free_instonelist(list); free_instonelist(list);
return 0; /* let the caller know we hit a bad failure */
return -1;
} }
if (pointer == NULL) { if (pointer == NULL) {

Loading…
Cancel
Save