From ecc138f858fab61e0b888d3d13854d1422c3432b Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 16 Jul 2015 19:41:45 +0200 Subject: just-in-time creation for (implicit) Provides Expecting the worst is easy to code, but has its disadvantages e.g. by creating package structures which otherwise would have never existed. By creating the provides instead at the time a package structure is added we are well prepared for the introduction of partial architectures, massive amounts of M-A:foreign (and :allowed) and co as far as provides are concerned at least. We have something relatively similar for dependencies already. Many tests are added for both M-A states and the code cleaned to properly support implicit provides for foreign architectures and architectures we 'just' happen to parse. Git-Dch: Ignore --- test/integration/test-multiarch-allowed | 246 ++++++++++++++++++++++++++++++++ 1 file changed, 246 insertions(+) create mode 100755 test/integration/test-multiarch-allowed (limited to 'test/integration/test-multiarch-allowed') diff --git a/test/integration/test-multiarch-allowed b/test/integration/test-multiarch-allowed new file mode 100755 index 000000000..a643cd2dc --- /dev/null +++ b/test/integration/test-multiarch-allowed @@ -0,0 +1,246 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'amd64' 'i386' + +insertpackage 'unstable' 'foo' 'amd64,i386' '1' 'Multi-Arch: allowed' +insertpackage 'unstable' 'needsfoo' 'amd64,i386' '1' 'Depends: foo' +insertpackage 'unstable' 'needsfooany' 'amd64,i386' '1' 'Depends: foo:any' +insertpackage 'unstable' 'needsfoover1' 'amd64,i386' '1' 'Depends: foo:any (>= 1)' +insertpackage 'unstable' 'needsfoover2' 'amd64,i386' '1' 'Depends: foo:any (>= 2)' +insertpackage 'unstable' 'hatesfoo' 'amd64' '1' 'Conflicts: foo' +insertpackage 'unstable' 'hatesfooany' 'amd64' '1' 'Conflicts: foo:any' # this makes no sense… +insertpackage 'unstable' 'hatesfoonative' 'amd64' '1' 'Conflicts: foo:amd64' + +insertpackage 'unstable' 'coolfoo' 'amd64' '1' 'Multi-Arch:allowed +Provides: coolbar' +insertpackage 'unstable' 'coolfoover' 'amd64' '1' 'Multi-Arch:allowed +Provides: coolbar (= 2)' +insertpackage 'unstable' 'needscoolfoo' 'amd64' '1' 'Depends: coolfoo, coolbar' +insertpackage 'unstable' 'needscoolfooany' 'amd64' '1' 'Depends: coolfoo:any, coolbar:any' +insertpackage 'unstable' 'needscoolfoover0' 'amd64' '1' 'Depends: coolfoo:any (>= 1), coolbar' +insertpackage 'unstable' 'needscoolfoover1' 'amd64' '1' 'Depends: coolfoo:any (>= 1), coolbar (>= 1)' +insertpackage 'unstable' 'needscoolfoover2' 'amd64' '1' 'Depends: coolfoo:any (>= 2), coolbar (>= 1)' +insertpackage 'unstable' 'needscoolfoover3' 'amd64' '1' 'Depends: coolfoo:any (>= 2), coolbar (>= 3)' + +setupaptarchive + +BADPREFIX='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: +' + +solveableinsinglearch0() { + testsuccessequal 'Reading package lists... +Building dependency tree... +The following extra packages will be installed: + foo +The following NEW packages will be installed: + foo needsfoo +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst foo (1 unstable [amd64]) +Inst needsfoo (1 unstable [amd64]) +Conf foo (1 unstable [amd64]) +Conf needsfoo (1 unstable [amd64])' aptget install needsfoo -s +} +solveableinsinglearch0 +testsuccessequal 'Reading package lists... +Building dependency tree... +The following extra packages will be installed: + foo:i386 +The following NEW packages will be installed: + foo:i386 needsfoo:i386 +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst foo:i386 (1 unstable [i386]) +Inst needsfoo:i386 (1 unstable [i386]) +Conf foo:i386 (1 unstable [i386]) +Conf needsfoo:i386 (1 unstable [i386])' aptget install needsfoo:i386 -s +testfailureequal "$BADPREFIX +The following packages have unmet dependencies: + needsfoo:i386 : Depends: foo:i386 but it is not going to be installed +E: Unable to correct problems, you have held broken packages." aptget install needsfoo:i386 foo:amd64 -s +testfailureequal "$BADPREFIX +The following packages have unmet dependencies: + needsfoo : Depends: foo but it is not going to be installed +E: Unable to correct problems, you have held broken packages." aptget install needsfoo foo:i386 -s + +solveableinsinglearch1() { + testsuccessequal "Reading package lists... +Building dependency tree... +The following extra packages will be installed: + foo +The following NEW packages will be installed: + foo $1 +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst foo (1 unstable [amd64]) +Inst $1 (1 unstable [amd64]) +Conf foo (1 unstable [amd64]) +Conf $1 (1 unstable [amd64])" aptget install $1 -s +} + +testneedsfooallgood() { + solveableinsinglearch1 $1 + testsuccessequal "Reading package lists... +Building dependency tree... +The following extra packages will be installed: + foo +The following NEW packages will be installed: + foo $1:i386 +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst foo (1 unstable [amd64]) +Inst $1:i386 (1 unstable [i386]) +Conf foo (1 unstable [amd64]) +Conf $1:i386 (1 unstable [i386])" aptget install $1:i386 -s + testsuccessequal "Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + foo:i386 $1:i386 +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst foo:i386 (1 unstable [i386]) +Inst $1:i386 (1 unstable [i386]) +Conf foo:i386 (1 unstable [i386]) +Conf $1:i386 (1 unstable [i386])" aptget install $1:i386 foo:i386 -s + testsuccessequal "Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + foo:i386 $1 +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst foo:i386 (1 unstable [i386]) +Inst $1 (1 unstable [amd64]) +Conf foo:i386 (1 unstable [i386]) +Conf $1 (1 unstable [amd64])" aptget install $1 foo:i386 -s +} +testneedsfooallgood 'needsfooany' +testneedsfooallgood 'needsfoover1' + +NEEDSFOO2NATIVE="$BADPREFIX +The following packages have unmet dependencies: + needsfoover2 : Depends: foo:any (>= 2) +E: Unable to correct problems, you have held broken packages." +NEEDSFOO2FOREIGN="$BADPREFIX +The following packages have unmet dependencies: + needsfoover2:i386 : Depends: foo:any:i386 (>= 2) +E: Unable to correct problems, you have held broken packages." +testfailureequal "$NEEDSFOO2NATIVE" aptget install needsfoover2 -s +testfailureequal "$NEEDSFOO2FOREIGN" aptget install needsfoover2:i386 -s +testfailureequal "$NEEDSFOO2FOREIGN" aptget install needsfoover2:i386 foo:i386 -s +testfailureequal "$NEEDSFOO2NATIVE" aptget install needsfoover2 foo:i386 -s + +solveableinsinglearch2() { + testfailureequal "$BADPREFIX +The following packages have unmet dependencies: + hatesfoo : Conflicts: foo but 1 is to be installed +E: Unable to correct problems, you have held broken packages." aptget install foo hatesfoo -s + testfailureequal "$BADPREFIX +The following packages have unmet dependencies: + hatesfooany : Conflicts: foo:any +E: Unable to correct problems, you have held broken packages." aptget install foo hatesfooany -s + testfailureequal "$BADPREFIX +The following packages have unmet dependencies: + hatesfoonative : Conflicts: foo but 1 is to be installed +E: Unable to correct problems, you have held broken packages." aptget install foo hatesfoonative -s +} +solveableinsinglearch2 +testfailureequal "$BADPREFIX +The following packages have unmet dependencies: + hatesfoo : Conflicts: foo:i386 but 1 is to be installed +E: Unable to correct problems, you have held broken packages." aptget install foo:i386 hatesfoo -s +testfailureequal "$BADPREFIX +The following packages have unmet dependencies: + hatesfooany : Conflicts: foo:any +E: Unable to correct problems, you have held broken packages." aptget install foo:i386 hatesfooany -s +testsuccessequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + foo:i386 hatesfoonative +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst foo:i386 (1 unstable [i386]) +Inst hatesfoonative (1 unstable [amd64]) +Conf foo:i386 (1 unstable [i386]) +Conf hatesfoonative (1 unstable [amd64])' aptget install foo:i386 hatesfoonative -s + +solveableinsinglearch3() { + testsuccessequal "Reading package lists... +Building dependency tree... +The following extra packages will be installed: + coolfoo +The following NEW packages will be installed: + coolfoo needscoolfoo +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst coolfoo (1 unstable [amd64]) +Inst needscoolfoo (1 unstable [amd64]) +Conf coolfoo (1 unstable [amd64]) +Conf needscoolfoo (1 unstable [amd64])" aptget install needscoolfoo -s + testsuccessequal "Reading package lists... +Building dependency tree... +The following extra packages will be installed: + coolfoo +The following NEW packages will be installed: + coolfoo coolfoover needscoolfoo +0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded. +Inst coolfoo (1 unstable [amd64]) +Inst coolfoover (1 unstable [amd64]) +Inst needscoolfoo (1 unstable [amd64]) +Conf coolfoo (1 unstable [amd64]) +Conf coolfoover (1 unstable [amd64]) +Conf needscoolfoo (1 unstable [amd64])" aptget install needscoolfoo coolfoover -s + testfailureequal "$BADPREFIX +The following packages have unmet dependencies: + needscoolfooany : Depends: coolbar:any but it is not installable +E: Unable to correct problems, you have held broken packages." aptget install needscoolfooany -s + testsuccessequal 'Reading package lists... +Building dependency tree... +The following extra packages will be installed: + coolfoo +The following NEW packages will be installed: + coolfoo needscoolfoover0 +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst coolfoo (1 unstable [amd64]) +Inst needscoolfoover0 (1 unstable [amd64]) +Conf coolfoo (1 unstable [amd64]) +Conf needscoolfoover0 (1 unstable [amd64])' aptget install needscoolfoover0 -s + testsuccessequal 'Reading package lists... +Building dependency tree... +The following extra packages will be installed: + coolfoo coolfoover +The following NEW packages will be installed: + coolfoo coolfoover needscoolfoover1 +0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded. +Inst coolfoo (1 unstable [amd64]) +Inst coolfoover (1 unstable [amd64]) +Inst needscoolfoover1 (1 unstable [amd64]) +Conf coolfoo (1 unstable [amd64]) +Conf coolfoover (1 unstable [amd64]) +Conf needscoolfoover1 (1 unstable [amd64])' aptget install needscoolfoover1 -s + testfailureequal "$BADPREFIX +The following packages have unmet dependencies: + needscoolfoover2 : Depends: coolfoo:any (>= 2) +E: Unable to correct problems, you have held broken packages." aptget install needscoolfoover2 -s + testfailureequal "$BADPREFIX +The following packages have unmet dependencies: + needscoolfoover3 : Depends: coolfoo:any (>= 2) + Depends: coolbar (>= 3) +E: Unable to correct problems, you have held broken packages." aptget install needscoolfoover3 -s +} +solveableinsinglearch3 + +msgmsg 'switch to single architecture' +configarchitecture 'amd64' + +solveableinsinglearch0 +testfailureequal 'Reading package lists... +Building dependency tree... +E: Unable to locate package needsfoo' aptget install needsfoo:i386 -s + +solveableinsinglearch1 'needsfooany' +solveableinsinglearch1 'needsfoover1' +testfailureequal "$NEEDSFOO2NATIVE" aptget install needsfoover2 -s +solveableinsinglearch2 +solveableinsinglearch3 -- cgit v1.2.3 From bb0f6a34c4cebea7884de828c011dc85765ff820 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 17 Jul 2015 10:53:01 +0200 Subject: just-in-time creation for (explicit) negative deps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now that we deal with provides in a more dynamic fashion the last remaining problem is explicit dependencies like 'Conflicts: foo' which have to apply to all architectures, but creating them all at the same time requires us to know all architectures ending up in the cache which isn't needed to be the same set as all foreign architectures. The effect is visible already now through as this prevents the creation of a bunch of virtual packages for arch:all packages and as such also many dependencies, just not very visible if you don't look at the stats… Git-Dch Ignore --- test/integration/test-multiarch-allowed | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'test/integration/test-multiarch-allowed') diff --git a/test/integration/test-multiarch-allowed b/test/integration/test-multiarch-allowed index a643cd2dc..2c791ca19 100755 --- a/test/integration/test-multiarch-allowed +++ b/test/integration/test-multiarch-allowed @@ -138,10 +138,8 @@ solveableinsinglearch2() { The following packages have unmet dependencies: hatesfoo : Conflicts: foo but 1 is to be installed E: Unable to correct problems, you have held broken packages." aptget install foo hatesfoo -s - testfailureequal "$BADPREFIX -The following packages have unmet dependencies: - hatesfooany : Conflicts: foo:any -E: Unable to correct problems, you have held broken packages." aptget install foo hatesfooany -s + # the message differs slightly between single and multiarch + testfailuremsg 'E: Unable to correct problems, you have held broken packages.' aptget install foo hatesfooany -s testfailureequal "$BADPREFIX The following packages have unmet dependencies: hatesfoonative : Conflicts: foo but 1 is to be installed @@ -155,6 +153,7 @@ E: Unable to correct problems, you have held broken packages." aptget install fo testfailureequal "$BADPREFIX The following packages have unmet dependencies: hatesfooany : Conflicts: foo:any + Conflicts: foo:any:i386 E: Unable to correct problems, you have held broken packages." aptget install foo:i386 hatesfooany -s testsuccessequal 'Reading package lists... Building dependency tree... -- cgit v1.2.3 From e7ebb41440cbe298b07c7fb7c6b20a64a17200f0 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Mon, 17 Aug 2015 18:37:09 +0200 Subject: Fix the test suite again Gbp-Dch: ignore --- test/integration/test-multiarch-allowed | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'test/integration/test-multiarch-allowed') diff --git a/test/integration/test-multiarch-allowed b/test/integration/test-multiarch-allowed index 2c791ca19..2eb479c17 100755 --- a/test/integration/test-multiarch-allowed +++ b/test/integration/test-multiarch-allowed @@ -40,7 +40,7 @@ The following information may help to resolve the situation: solveableinsinglearch0() { testsuccessequal 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: foo The following NEW packages will be installed: foo needsfoo @@ -53,7 +53,7 @@ Conf needsfoo (1 unstable [amd64])' aptget install needsfoo -s solveableinsinglearch0 testsuccessequal 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: foo:i386 The following NEW packages will be installed: foo:i386 needsfoo:i386 @@ -74,7 +74,7 @@ E: Unable to correct problems, you have held broken packages." aptget install ne solveableinsinglearch1() { testsuccessequal "Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: foo The following NEW packages will be installed: foo $1 @@ -89,7 +89,7 @@ testneedsfooallgood() { solveableinsinglearch1 $1 testsuccessequal "Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: foo The following NEW packages will be installed: foo $1:i386 @@ -168,7 +168,7 @@ Conf hatesfoonative (1 unstable [amd64])' aptget install foo:i386 hatesfoonative solveableinsinglearch3() { testsuccessequal "Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: coolfoo The following NEW packages will be installed: coolfoo needscoolfoo @@ -179,7 +179,7 @@ Conf coolfoo (1 unstable [amd64]) Conf needscoolfoo (1 unstable [amd64])" aptget install needscoolfoo -s testsuccessequal "Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: coolfoo The following NEW packages will be installed: coolfoo coolfoover needscoolfoo @@ -196,7 +196,7 @@ The following packages have unmet dependencies: E: Unable to correct problems, you have held broken packages." aptget install needscoolfooany -s testsuccessequal 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: coolfoo The following NEW packages will be installed: coolfoo needscoolfoover0 @@ -207,7 +207,7 @@ Conf coolfoo (1 unstable [amd64]) Conf needscoolfoover0 (1 unstable [amd64])' aptget install needscoolfoover0 -s testsuccessequal 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: coolfoo coolfoover The following NEW packages will be installed: coolfoo coolfoover needscoolfoover1 -- cgit v1.2.3