From 65ce0eb3c0d71031c59c14c7e433b0b969548978 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 15 May 2020 16:44:49 +0200 Subject: Keep going if a dep is bad for user requests to improve errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We exit early from installing dependencies of a package only if it is not a user request to avoid polluting the state with installs which might not be needed (or detrimental even) for alternative choices. We do continue with installing dependencies though if it is a user request as it will improve error reporting for apt and can even help aptitude not hang itself so much as we trim the problem space down for its resolver dealing with all the easy things. Similar things can be said about the testcase I have short-circuit previously… keep going test, do what you should do to report errors! --- ...est-bug-549968-install-depends-of-not-installed | 1 + .../test-bug-618848-always-respect-user-requests | 5 +++-- .../test-explore-or-groups-in-markinstall | 26 ++++++++++++++++++---- test/integration/test-multiarch-allowed | 1 - 4 files changed, 26 insertions(+), 7 deletions(-) (limited to 'test') diff --git a/test/integration/test-bug-549968-install-depends-of-not-installed b/test/integration/test-bug-549968-install-depends-of-not-installed index fab67c4e9..75e7474ff 100755 --- a/test/integration/test-bug-549968-install-depends-of-not-installed +++ b/test/integration/test-bug-549968-install-depends-of-not-installed @@ -18,6 +18,7 @@ testsuccessequal "Reading package lists... Building dependency tree... MarkInstall coolstuff:i386 < none -> 1.0 @un puN IPb > FU=1 Ignore MarkInstall of extracoolstuff:i386 < none | 1.0 @hn puH > as its mode (Keep) is protected + coolstuff:i386 Recommends on extracoolstuff:i386 < none | 1.0 @hn puH > can't be satisfied! (dep) Package 'extracoolstuff' is not installed, so not removed Recommended packages: extracoolstuff diff --git a/test/integration/test-bug-618848-always-respect-user-requests b/test/integration/test-bug-618848-always-respect-user-requests index 230683a99..1e144f1ee 100755 --- a/test/integration/test-bug-618848-always-respect-user-requests +++ b/test/integration/test-bug-618848-always-respect-user-requests @@ -13,11 +13,12 @@ insertpackage 'unstable' 'exim4-daemon-heavy' 'all' '1.0' 'Depends: libdb4.8' setupaptarchive -testsuccessequal 'Reading package lists... +testsuccessequal "Reading package lists... Building dependency tree... MarkDelete libdb4.8:i386 < 1.0 @ii pmK > FU=1 MarkDelete exim4-daemon-light:i386 < 1.0 @ii mK Ib > FU=0 MarkInstall exim4-daemon-heavy:i386 < none -> 1.0 @un uN Ib > FU=0 + exim4-daemon-heavy:i386 Depends on libdb4.8:i386 < 1.0 @ii pmR > can't be satisfied! (dep) MarkDelete exim4:i386 < 1.0 @ii mK Ib > FU=0 The following packages will be REMOVED: exim4 exim4-daemon-light libdb4.8 @@ -27,4 +28,4 @@ Remv exim4 [1.0] MarkDelete exim4-daemon-light:i386 < 1.0 @ii K > FU=1 Remv exim4-daemon-light [1.0] MarkDelete libdb4.8:i386 < 1.0 @ii K > FU=1 -Remv libdb4.8 [1.0]' aptget remove libdb4.8 -s -o Debug::pkgDepCache::Marker=1 +Remv libdb4.8 [1.0]" aptget remove libdb4.8 -s -o Debug::pkgDepCache::Marker=1 diff --git a/test/integration/test-explore-or-groups-in-markinstall b/test/integration/test-explore-or-groups-in-markinstall index 763852fa5..7f49b23cb 100755 --- a/test/integration/test-explore-or-groups-in-markinstall +++ b/test/integration/test-explore-or-groups-in-markinstall @@ -9,16 +9,17 @@ configarchitecture 'amd64' insertpackage 'unstable' 'okay' 'all' '1' insertpackage 'unstable' 'upgrade' 'all' '2' insertpackage 'unstable' 'unneeded' 'all' '1' +insertpackage 'unstable' 'unneeded2' 'all' '1' 'Depends: bad-level1' insertpackage 'unstable' 'later' 'all' '1' insertpackage 'unstable' 'bad-level0' 'all' '1' 'Depends: unneeded, unknown' insertpackage 'unstable' 'bad-level1' 'all' '1' 'Depends: bad-level0' insertpackage 'unstable' 'bad-upgrade-level0' 'all' '2' 'Depends: unneeded, unknown' -insertpackage 'unstable' 'bad-upgrade-level1' 'all' '2' 'Depends: bad-upgrade-level0 (>= 2)' +insertpackage 'unstable' 'bad-upgrade-level1' 'all' '2' 'Depends: bad-upgrade-level0 (>= 2), unneeded2' insertpackage 'unstable' 'bad-conflict-level0' 'all' '1' 'Depends: unneeded Conflicts: bad-conflict-level2' insertpackage 'unstable' 'bad-conflict-level1' 'all' '1' 'Depends: bad-conflict-level0' -insertpackage 'unstable' 'bad-conflict-level2' 'all' '1' 'Depends: bad-conflict-level1' +insertpackage 'unstable' 'bad-conflict-level2' 'all' '1' 'Depends: bad-conflict-level1, unneeded2' insertinstalledpackage 'upgrade' 'all' '1' insertinstalledpackage 'bad-upgrade' 'all' '1' @@ -112,8 +113,25 @@ Would download/install/remove packages.' testsuccesstailequal 3 "$OKAYAPTITUDE" aptitude install foo-r-conflict -sy fi -testfailure apt install bad-upgrade-level1 -s -testfailure apt install bad-conflict-level2 -s +BADSOLVETEXT='Reading package lists... +Building dependency tree... +Some packages could not be installed. This may mean that you have +requested an impossible situation or if you are using the unstable +distribution that some required packages have not yet been created +or been moved out of Incoming. +The following information may help to resolve the situation: +' + +testfailureequal "$BADSOLVETEXT +The following packages have unmet dependencies: + bad-level0 : Depends: unknown but it is not installable + bad-upgrade-level0 : Depends: unknown but it is not installable +E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages." apt install bad-upgrade-level1 -s +testfailureequal "$BADSOLVETEXT +The following packages have unmet dependencies: + bad-conflict-level0 : Conflicts: bad-conflict-level2 but 1 is to be installed + bad-level0 : Depends: unknown but it is not installable +E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages." apt install bad-conflict-level2 -s if $TEST_WITH_APTITUDE; then testsuccesstailequal 6 'The following packages have been kept back: diff --git a/test/integration/test-multiarch-allowed b/test/integration/test-multiarch-allowed index b74853993..167f0c584 100755 --- a/test/integration/test-multiarch-allowed +++ b/test/integration/test-multiarch-allowed @@ -72,7 +72,6 @@ The following packages have unmet dependencies: foo : Conflicts: foo:i386 but 1 is to be installed foo:i386 : Conflicts: foo but 1 is to be installed E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages." aptget install needsfoo foo:i386 -s -exit solveableinsinglearch1() { testsuccessequal "Reading package lists... -- cgit v1.2.3