From d39d7f885d61bfe296c131c83bdc042a2ab6b0d7 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 17 Jun 2014 17:45:33 +0200 Subject: show our broken packages message in 'apt' solver --- cmdline/apt-internal-solver.cc | 24 ++++++++++++++---------- cmdline/makefile | 20 ++++++++++---------- 2 files changed, 24 insertions(+), 20 deletions(-) (limited to 'cmdline') diff --git a/cmdline/apt-internal-solver.cc b/cmdline/apt-internal-solver.cc index e4cdf6381..5fda7b6a0 100644 --- a/cmdline/apt-internal-solver.cc +++ b/cmdline/apt-internal-solver.cc @@ -24,9 +24,11 @@ #include #include #include +#include #include #include +#include #include #include #include @@ -168,18 +170,20 @@ int main(int argc,const char *argv[]) /*{{{*/ EDSP::WriteProgress(60, "Call problemresolver on current scenario…", output); + std::string failure; if (upgrade == true) { - if (pkgAllUpgrade(CacheFile) == false) { - EDSP::WriteError("ERR_UNSOLVABLE_UPGRADE", "An upgrade error occurred", output); - return 0; - } + if (pkgAllUpgrade(CacheFile) == false) + failure = "ERR_UNSOLVABLE_UPGRADE"; } else if (distUpgrade == true) { - if (pkgDistUpgrade(CacheFile) == false) { - EDSP::WriteError("ERR_UNSOLVABLE_DIST_UPGRADE", "An dist-upgrade error occurred", output); - return 0; - } - } else if (Fix.Resolve() == false) { - EDSP::WriteError("ERR_UNSOLVABLE", "An error occurred", output); + if (pkgDistUpgrade(CacheFile) == false) + failure = "ERR_UNSOLVABLE_DIST_UPGRADE"; + } else if (Fix.Resolve() == false) + failure = "ERR_UNSOLVABLE"; + + if (failure.empty() == false) { + std::ostringstream broken; + ShowBroken(broken, CacheFile, false); + EDSP::WriteError(failure.c_str(), broken.str(), output); return 0; } diff --git a/cmdline/makefile b/cmdline/makefile index c4a249cd6..b7c35ddd1 100644 --- a/cmdline/makefile +++ b/cmdline/makefile @@ -8,49 +8,49 @@ include ../buildlib/defaults.mak # The apt program PROGRAM=apt SLIBS = -lapt-pkg -lapt-private $(INTLLIBS) -LIB_MAKES = apt-pkg/makefile +LIB_MAKES = apt-pkg/makefile apt-private/makefile SOURCE = apt.cc include $(PROGRAM_H) # The apt-cache program PROGRAM=apt-cache SLIBS = -lapt-pkg -lapt-private $(INTLLIBS) -LIB_MAKES = apt-pkg/makefile +LIB_MAKES = apt-pkg/makefile apt-private/makefile SOURCE = apt-cache.cc include $(PROGRAM_H) # The apt-get program PROGRAM=apt-get SLIBS = -lapt-pkg -lapt-private $(INTLLIBS) -LIB_MAKES = apt-pkg/makefile +LIB_MAKES = apt-pkg/makefile apt-private/makefile SOURCE = apt-get.cc include $(PROGRAM_H) # The apt-config program PROGRAM=apt-config SLIBS = -lapt-pkg -lapt-private $(INTLLIBS) -LIB_MAKES = apt-pkg/makefile +LIB_MAKES = apt-pkg/makefile apt-private/makefile SOURCE = apt-config.cc include $(PROGRAM_H) # The apt-cdrom program PROGRAM=apt-cdrom SLIBS = -lapt-pkg -lapt-private $(INTLLIBS) -LIB_MAKES = apt-pkg/makefile +LIB_MAKES = apt-pkg/makefile apt-private/makefile SOURCE = apt-cdrom.cc include $(PROGRAM_H) # The apt-mark program PROGRAM=apt-mark SLIBS = -lapt-pkg -lapt-private $(INTLLIBS) -LIB_MAKES = apt-pkg/makefile +LIB_MAKES = apt-pkg/makefile apt-private/makefile SOURCE = apt-mark.cc include $(PROGRAM_H) # The apt-helper PROGRAM=apt-helper SLIBS = -lapt-pkg -lapt-private $(INTLLIBS) -LIB_MAKES = apt-pkg/makefile +LIB_MAKES = apt-pkg/makefile apt-private/makefile SOURCE = apt-helper.cc include $(PROGRAM_H) @@ -75,14 +75,14 @@ include $(PROGRAM_H) # The apt-extracttemplates program PROGRAM=apt-extracttemplates SLIBS = -lapt-pkg -lapt-inst $(INTLLIBS) -LIB_MAKES = apt-pkg/makefile +LIB_MAKES = apt-pkg/makefile apt-inst/makefile SOURCE = apt-extracttemplates.cc include $(PROGRAM_H) # The internal solver acting as an external PROGRAM=apt-internal-solver -SLIBS = -lapt-pkg $(INTLLIBS) -LIB_MAKES = apt-pkg/makefile +SLIBS = -lapt-pkg -lapt-private $(INTLLIBS) +LIB_MAKES = apt-pkg/makefile apt-private/makefile SOURCE = apt-internal-solver.cc include $(PROGRAM_H) -- cgit v1.2.3