diff options
author | David Kalnischkies <david@kalnischkies.de> | 2020-05-22 18:56:40 +0200 |
---|---|---|
committer | David Kalnischkies <david@kalnischkies.de> | 2020-05-23 17:58:42 +0200 |
commit | 04a020d7a217d6b5af86c048c2974760053b8079 (patch) | |
tree | dd07954a2327cb2c00a19292ccd1562e18c18205 /test/integration/test-bug-961266-hold-means-hold | |
parent | 9d0a37e9cf644f99666b60e5a1ca5131fd0c6519 (diff) |
Reset candidate version explicitly for internal state-keeping
For a (partially) installed package like the one MarkInstall operates on
at the moment we want to discard the candidate from, we have to first
remove the package from the internal state keeping to have proper broken
counts and such and only then reset the candidate version which is a
trivial operation in comparison.
Take a look at the testcase: Now, what is the problem? Correct,
git:i386. Didn't see that coming, right? It is M-A:foreign so apt tries
to switch the architecture of git here (which is pointless, it knows
that this won't work, but lets fix that in another commit) will
eventually realize that it can't install it and wants to discard the
candidate of git:i386 first removing the broken indication like it
should, removing the install flag and then reapplies the broken
indication: Expect it doesn't as it wants to do that over the candidate
version which the package no longer had so seemingly nothing is broken.
It is a bit of a hairball to figure out which commit it is exactly that
is wrong here as they are all influencing each other a bit, but >= 2.1
is an acceptable ballpark. Bisect says 57df273 but that is mostly a lie.
Closes: #961266
Diffstat (limited to 'test/integration/test-bug-961266-hold-means-hold')
-rwxr-xr-x | test/integration/test-bug-961266-hold-means-hold | 130 |
1 files changed, 130 insertions, 0 deletions
diff --git a/test/integration/test-bug-961266-hold-means-hold b/test/integration/test-bug-961266-hold-means-hold new file mode 100755 index 000000000..a104bfc31 --- /dev/null +++ b/test/integration/test-bug-961266-hold-means-hold @@ -0,0 +1,130 @@ +#!/bin/sh +set -e + +TESTDIR="$(readlink -f "$(dirname "$0")")" +. "$TESTDIR/framework" +setupenvironment +configarchitecture 'amd64' 'i386' + +insertinstalledpackage 'git' 'amd64' '1:2.25.1-1' 'Multi-Arch: foreign' +insertinstalledpackage 'git-cvs' 'amd64' '1:2.25.1-1' 'Depends: git (>> 1:2.25.1), git (<< 1:2.25.1-.)' + + +insertpackage 'unstable' 'git' 'amd64,i386' '1:2.26.2-1' 'Multi-Arch: foreign' +insertpackage 'unstable' 'git-cvs' 'amd64,i386' '1:2.26.2-1' 'Depends: git (>> 1:2.26.2), git (<< 1:2.26.2-.)' +insertpackage 'unstable' 'git-ng' 'amd64,i386' '1:2.26.2-1' 'Depends: git (>> 1:2.26.2), git (<< 1:2.26.2-.)' + +setupaptarchive + +msgmsg 'The setup is' 'fine' +UPGRADE='Reading package lists... +Building dependency tree... +Calculating upgrade... +The following packages will be upgraded: + git git-cvs +2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. +Inst git-cvs [1:2.25.1-1] (1:2.26.2-1 unstable [amd64]) [] +Inst git [1:2.25.1-1] (1:2.26.2-1 unstable [amd64]) +Conf git-cvs (1:2.26.2-1 unstable [amd64]) +Conf git (1:2.26.2-1 unstable [amd64])' +testsuccessequal "$UPGRADE" apt upgrade -s +testsuccessequal "$UPGRADE" aptget upgrade -s +testsuccessequal "$UPGRADE" apt full-upgrade -s +testsuccessequal "$UPGRADE" aptget dist-upgrade -s + +testsuccessequal 'Reading package lists... +Building dependency tree... +The following additional packages will be installed: + git git-cvs +The following NEW packages will be installed: + git-ng +The following packages will be upgraded: + git git-cvs +2 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +Inst git-cvs [1:2.25.1-1] (1:2.26.2-1 unstable [amd64]) [] +Inst git [1:2.25.1-1] (1:2.26.2-1 unstable [amd64]) +Inst git-ng (1:2.26.2-1 unstable [amd64]) +Conf git-cvs (1:2.26.2-1 unstable [amd64]) +Conf git (1:2.26.2-1 unstable [amd64]) +Conf git-ng (1:2.26.2-1 unstable [amd64])' apt install git-ng -s + + +msgmsg 'Now mix it up by' 'holding git' +testsuccessequal 'git set on hold.' aptmark hold git +testsuccessequal 'git' aptmark showholds + +NOUPGRADE='Reading package lists... +Building dependency tree... +Calculating upgrade... +The following packages have been kept back: + git +0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.' +NOUPGRADE2='Reading package lists... +Building dependency tree... +Calculating upgrade... +The following packages have been kept back: + git git-cvs +0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.' + +testsuccessequal "$NOUPGRADE" apt upgrade -s +testsuccessequal "$NOUPGRADE" apt full-upgrade -s +testsuccessequal "$NOUPGRADE" aptget dist-upgrade -s +testsuccessequal "$NOUPGRADE2" aptget upgrade -s + +testfailureequal '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: + +The following packages have unmet dependencies: + git-ng : Depends: git (> 1:2.26.2) +E: Unable to correct problems, you have held broken packages.' apt install git-ng -s + + +msgmsg 'Now mix it up by' 'holding git-cvs' +testsuccessequal 'Canceled hold on git.' aptmark unhold git +testsuccessequal 'git-cvs set on hold.' aptmark hold git-cvs +testsuccessequal 'git-cvs' aptmark showholds + +testsuccessequal "$NOUPGRADE2" apt upgrade -s +testsuccessequal "$NOUPGRADE2" apt full-upgrade -s +testsuccessequal "$NOUPGRADE2" aptget upgrade -s +testsuccessequal "$NOUPGRADE2" aptget dist-upgrade -s + +testfailureequal '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: + +The following packages have unmet dependencies: + git-cvs : Depends: git (< 1:2.25.1-.) +E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.' apt install git-ng -s + + +msgmsg 'Now mix it up by' 'holding both' +testsuccessequal 'git set on hold.' aptmark hold git +testsuccessequal 'git +git-cvs' aptmark showholds + +testsuccessequal "$NOUPGRADE2" apt upgrade -s +testsuccessequal "$NOUPGRADE2" apt full-upgrade -s +testsuccessequal "$NOUPGRADE2" aptget upgrade -s +testsuccessequal "$NOUPGRADE2" aptget dist-upgrade -s + +testfailureequal '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: + +The following packages have unmet dependencies: + git-ng : Depends: git (> 1:2.26.2) +E: Unable to correct problems, you have held broken packages.' apt install git-ng -s |