From c4cca79156ef5651e90772bae5f4aa11f669907d Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 11 Nov 2011 16:03:40 +0100 Subject: - provide a {Package,Version}List similar to {Package,Version}Set * cmdline/apt-{get,cache,mark}.cc: - use Lists instead of Sets if input order should be preserved for commands accepting lists of packages, e.g. policy (Closes: #625960) --- test/integration/Packages-pdiff-usage-new | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'test/integration') diff --git a/test/integration/Packages-pdiff-usage-new b/test/integration/Packages-pdiff-usage-new index 9157596a7..4f374b37f 100644 --- a/test/integration/Packages-pdiff-usage-new +++ b/test/integration/Packages-pdiff-usage-new @@ -1,16 +1,3 @@ -Package: newstuff -Version: 1.0 -Architecture: i386 -Maintainer: Joe Sixpack -Installed-Size: 101 -Filename: pool/newstuff_1.0_i386.deb -Size: 101100 -MD5sum: 311aeeadf78324aaff1ceaf3e1f76671 -SHA1: 3c695e028f7a1ae324deeddaaa1242desa81088c -SHA256: b46fd154615edefab321cc56a5cc0e7deaef23e2da3e4f129727fd660f28f050 -Description: some cool and shiny new stuff - This package will appear in the next mirror update - Package: apt Priority: important Section: admin @@ -35,3 +22,16 @@ Description: Advanced front-end for dpkg . APT features complete installation ordering, multiple source capability and several other unique features, see the Users Guide in apt-doc. + +Package: newstuff +Version: 1.0 +Architecture: i386 +Maintainer: Joe Sixpack +Installed-Size: 101 +Filename: pool/newstuff_1.0_i386.deb +Size: 101100 +MD5sum: 311aeeadf78324aaff1ceaf3e1f76671 +SHA1: 3c695e028f7a1ae324deeddaaa1242desa81088c +SHA256: b46fd154615edefab321cc56a5cc0e7deaef23e2da3e4f129727fd660f28f050 +Description: some cool and shiny new stuff + This package will appear in the next mirror update -- cgit v1.2.3 From 2b5c35c7bb915dbd46fefd7c79f05364ba22f93b Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 23 Nov 2011 00:49:45 +0100 Subject: * apt-pkg/depcache.cc: - prefer native providers over foreigns even if the chain is foreign The code preferred real over virtual packages and based on priorities. This is changed in so far that a real package from any arch is preferred over any virtual provider and if priorities doesn't help in choosing the best provider we choose it based on architectures --- test/integration/test-multiarch-foreign | 128 ++++++++++++++++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100755 test/integration/test-multiarch-foreign (limited to 'test/integration') diff --git a/test/integration/test-multiarch-foreign b/test/integration/test-multiarch-foreign new file mode 100755 index 000000000..d0ad829a7 --- /dev/null +++ b/test/integration/test-multiarch-foreign @@ -0,0 +1,128 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'amd64' 'i386' 'armel' + +insertpackage 'unstable' 'cool-foo' 'amd64,i386' '1.0' 'Depends: foo' +insertpackage 'unstable' 'foo' 'amd64,i386,armel' '1.0' 'Multi-Arch: foreign' + +insertpackage 'unstable' 'cool-bar' 'amd64,i386' '1.0' 'Depends: bar-provider' +insertpackage 'unstable' 'bar' 'amd64,i386,armel' '1.0' 'Provides: bar-provider +Multi-Arch: foreign' + +setupaptarchive + +testequal 'Reading package lists... +Building dependency tree... +The following extra packages will be installed: + foo +The following NEW packages will be installed: + cool-foo:i386 foo +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst foo (1.0 unstable [amd64]) +Inst cool-foo:i386 (1.0 unstable [i386]) +Conf foo (1.0 unstable [amd64]) +Conf cool-foo:i386 (1.0 unstable [i386])' aptget install cool-foo:i386 -s + +testequal 'Reading package lists... +Building dependency tree... +The following extra packages will be installed: + foo +The following NEW packages will be installed: + cool-foo foo +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst foo (1.0 unstable [amd64]) +Inst cool-foo (1.0 unstable [amd64]) +Conf foo (1.0 unstable [amd64]) +Conf cool-foo (1.0 unstable [amd64])' aptget install cool-foo:amd64 -s + +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + cool-foo foo +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst foo (1.0 unstable [amd64]) +Inst cool-foo (1.0 unstable [amd64]) +Conf foo (1.0 unstable [amd64]) +Conf cool-foo (1.0 unstable [amd64])' aptget install cool-foo:amd64 foo:amd64 -s + +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + cool-foo foo:i386 +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst foo:i386 (1.0 unstable [i386]) +Inst cool-foo (1.0 unstable [amd64]) +Conf foo:i386 (1.0 unstable [i386]) +Conf cool-foo (1.0 unstable [amd64])' aptget install cool-foo:amd64 foo:i386 -s + +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + cool-foo foo:armel +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst foo:armel (1.0 unstable [armel]) +Inst cool-foo (1.0 unstable [amd64]) +Conf foo:armel (1.0 unstable [armel]) +Conf cool-foo (1.0 unstable [amd64])' aptget install cool-foo:amd64 foo:armel -s + + + + + +testequal 'Reading package lists... +Building dependency tree... +The following extra packages will be installed: + bar +The following NEW packages will be installed: + bar cool-bar:i386 +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst bar (1.0 unstable [amd64]) +Inst cool-bar:i386 (1.0 unstable [i386]) +Conf bar (1.0 unstable [amd64]) +Conf cool-bar:i386 (1.0 unstable [i386])' aptget install cool-bar:i386 -s + +testequal 'Reading package lists... +Building dependency tree... +The following extra packages will be installed: + bar +The following NEW packages will be installed: + bar cool-bar +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst bar (1.0 unstable [amd64]) +Inst cool-bar (1.0 unstable [amd64]) +Conf bar (1.0 unstable [amd64]) +Conf cool-bar (1.0 unstable [amd64])' aptget install cool-bar:amd64 -s + +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + bar cool-bar +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst bar (1.0 unstable [amd64]) +Inst cool-bar (1.0 unstable [amd64]) +Conf bar (1.0 unstable [amd64]) +Conf cool-bar (1.0 unstable [amd64])' aptget install cool-bar:amd64 bar:amd64 -s + +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + bar:i386 cool-bar +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst bar:i386 (1.0 unstable [i386]) +Inst cool-bar (1.0 unstable [amd64]) +Conf bar:i386 (1.0 unstable [i386]) +Conf cool-bar (1.0 unstable [amd64])' aptget install cool-bar:amd64 bar:i386 -s + +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + bar:armel cool-bar +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst bar:armel (1.0 unstable [armel]) +Inst cool-bar (1.0 unstable [amd64]) +Conf bar:armel (1.0 unstable [armel]) +Conf cool-bar (1.0 unstable [amd64])' aptget install cool-bar:amd64 bar:armel -s -- cgit v1.2.3 From 286afa36886b60bea0a17d244f8bddad938f27cf Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 23 Nov 2011 09:54:17 +0100 Subject: * cmdline/apt-get.cc: - ignore foreign architectures if we check if a provides has only one resolver as it's basically the same for the user, so no need to choose --- test/integration/test-multiarch-foreign | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'test/integration') diff --git a/test/integration/test-multiarch-foreign b/test/integration/test-multiarch-foreign index d0ad829a7..332466d96 100755 --- a/test/integration/test-multiarch-foreign +++ b/test/integration/test-multiarch-foreign @@ -126,3 +126,25 @@ Inst bar:armel (1.0 unstable [armel]) Inst cool-bar (1.0 unstable [amd64]) Conf bar:armel (1.0 unstable [armel]) Conf cool-bar (1.0 unstable [amd64])' aptget install cool-bar:amd64 bar:armel -s + +testequal "Reading package lists... +Building dependency tree... +Note, selecting 'bar' instead of 'bar-provider' +The following NEW packages will be installed: + bar cool-bar +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst bar (1.0 unstable [amd64]) +Inst cool-bar (1.0 unstable [amd64]) +Conf bar (1.0 unstable [amd64]) +Conf cool-bar (1.0 unstable [amd64])" aptget install cool-bar bar-provider -s -q=0 + +testequal "Reading package lists... +Building dependency tree... +Note, selecting 'bar:i386' instead of 'bar-provider:i386' +The following NEW packages will be installed: + bar:i386 cool-bar +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst bar:i386 (1.0 unstable [i386]) +Inst cool-bar (1.0 unstable [amd64]) +Conf bar:i386 (1.0 unstable [i386]) +Conf cool-bar (1.0 unstable [amd64])" aptget install cool-bar bar-provider:i386 -s -q=0 -- cgit v1.2.3 From a7e052eae64486a31595bc9b3f4a1c02c13256e3 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 30 Nov 2011 16:37:09 +0100 Subject: ensure that we exit instead of proceed in execution after the trap (the execution leads to hard failures anyway) --- test/integration/framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/integration') diff --git a/test/integration/framework b/test/integration/framework index b55f793a4..2ea1844f0 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -102,7 +102,7 @@ aptitude() { addtrap() { CURRENTTRAP="$CURRENTTRAP $1" - trap "$CURRENTTRAP" 0 HUP INT QUIT ILL ABRT FPE SEGV PIPE TERM + trap "$CURRENTTRAP exit;" 0 HUP INT QUIT ILL ABRT FPE SEGV PIPE TERM } setupenvironment() { -- cgit v1.2.3 From 88a52816d7626326f94c17a3a8fcde08817b7f2b Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 11 Jan 2012 18:05:15 +0100 Subject: * apt-pkg/depcache.cc: - implicit conflicts (for multiarch) are supposed to conflict only with real packages, not with virtual providers --- .../test-implicit-conflicts-real-not-virtual | 40 ++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100755 test/integration/test-implicit-conflicts-real-not-virtual (limited to 'test/integration') diff --git a/test/integration/test-implicit-conflicts-real-not-virtual b/test/integration/test-implicit-conflicts-real-not-virtual new file mode 100755 index 000000000..9d13e1709 --- /dev/null +++ b/test/integration/test-implicit-conflicts-real-not-virtual @@ -0,0 +1,40 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'amd64' 'i386' + +insertpackage 'unstable-mp' 'crda' 'i386,amd64' '1.1.1-1ubuntu4mp' 'Provides: wireless-crda +Multi-Arch: foreign' +insertpackage 'unstable-m' 'crda' 'i386,amd64' '1.1.1-1ubuntu4m' 'Multi-Arch: foreign' +insertpackage 'unstable-p' 'crda' 'i386,amd64' '1.1.1-1ubuntu4p' 'Provides: wireless-crda' + +insertinstalledpackage 'wireless-crda' 'amd64' '1.14' + +setupaptarchive + +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + crda +0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +Inst crda (1.1.1-1ubuntu4m unstable-m [amd64]) +Conf crda (1.1.1-1ubuntu4m unstable-m [amd64])' aptget install crda -s -t unstable-m + +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + crda +0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +Inst crda (1.1.1-1ubuntu4p unstable-p [amd64]) +Conf crda (1.1.1-1ubuntu4p unstable-p [amd64])' aptget install crda -s -t unstable-p + +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + crda +0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +Inst crda (1.1.1-1ubuntu4mp unstable-mp [amd64]) +Conf crda (1.1.1-1ubuntu4mp unstable-mp [amd64])' aptget install crda -s -t unstable-mp -- cgit v1.2.3 From 5f909b67fb903f700df1bd6242ada86d58c0b068 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 13 Jan 2012 12:48:41 +0100 Subject: * apt-pkg/pkgcache.cc: - ignore implicit conflicts on providers in AllTarget, too --- .../test-implicit-conflicts-real-not-virtual | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'test/integration') diff --git a/test/integration/test-implicit-conflicts-real-not-virtual b/test/integration/test-implicit-conflicts-real-not-virtual index 9d13e1709..c9fca4edf 100755 --- a/test/integration/test-implicit-conflicts-real-not-virtual +++ b/test/integration/test-implicit-conflicts-real-not-virtual @@ -10,6 +10,8 @@ insertpackage 'unstable-mp' 'crda' 'i386,amd64' '1.1.1-1ubuntu4mp' 'Provides: wi Multi-Arch: foreign' insertpackage 'unstable-m' 'crda' 'i386,amd64' '1.1.1-1ubuntu4m' 'Multi-Arch: foreign' insertpackage 'unstable-p' 'crda' 'i386,amd64' '1.1.1-1ubuntu4p' 'Provides: wireless-crda' +insertpackage 'unstable' 'wireless-crda' 'i386,amd64' '1.16' + insertinstalledpackage 'wireless-crda' 'amd64' '1.14' @@ -19,7 +21,7 @@ testequal 'Reading package lists... Building dependency tree... The following NEW packages will be installed: crda -0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded. Inst crda (1.1.1-1ubuntu4m unstable-m [amd64]) Conf crda (1.1.1-1ubuntu4m unstable-m [amd64])' aptget install crda -s -t unstable-m @@ -27,7 +29,7 @@ testequal 'Reading package lists... Building dependency tree... The following NEW packages will be installed: crda -0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded. Inst crda (1.1.1-1ubuntu4p unstable-p [amd64]) Conf crda (1.1.1-1ubuntu4p unstable-p [amd64])' aptget install crda -s -t unstable-p @@ -35,6 +37,20 @@ testequal 'Reading package lists... Building dependency tree... The following NEW packages will be installed: crda -0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded. Inst crda (1.1.1-1ubuntu4mp unstable-mp [amd64]) Conf crda (1.1.1-1ubuntu4mp unstable-mp [amd64])' aptget install crda -s -t unstable-mp + +rm rootdir/var/lib/dpkg/status +insertinstalledpackage 'crda' 'amd64' '1.1.1-1ubuntu4mp' 'Provides: wireless-crda +Conflicts: wireless-crda (<< 1.15) +Replaces: wireless-crda ( << 1.15) +Multi-arch: foreign' + +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + wireless-crda +0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded. +Inst wireless-crda (1.16 unstable [amd64]) +Conf wireless-crda (1.16 unstable [amd64])' aptget install wireless-crda -s -t unstable -- cgit v1.2.3 From 86fc2ca8909eb686e2ad751acb0f0eaf706d9d5e Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 13 Jan 2012 17:30:17 +0100 Subject: * apt-pkg/deb/dpkgpm.cc: - check if dpkg supports multiarch with --assert-multi-arch and if it does be always explicit about the architecture --- test/integration/test-dpkg-assert-multi-arch | 53 ++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100755 test/integration/test-dpkg-assert-multi-arch (limited to 'test/integration') diff --git a/test/integration/test-dpkg-assert-multi-arch b/test/integration/test-dpkg-assert-multi-arch new file mode 100755 index 000000000..b1ec73e18 --- /dev/null +++ b/test/integration/test-dpkg-assert-multi-arch @@ -0,0 +1,53 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'amd64' 'i386' + +buildsimplenativepackage 'native-pkg' 'amd64' '1.0' 'stable' +buildsimplenativepackage 'foreign-pkg' 'i386' '0.5' 'stable' 'Multi-Arch: foreign' +buildsimplenativepackage 'same-lib' 'amd64,i386' '0.5' 'stable' 'Multi-Arch: same' + +setupaptarchive + +testqualifier() { + msgtest 'Test for correct qualifier mode' $2 + GIVEN="$(aptget install $1 -qq -o Debug::pkgDPkgPM=1 2>&1 | grep -- '--configure' | sed -e 's/^.*--configure \([^ ]*\).*$/\1/')" + test "$GIVEN" = "$2" && msgpass || msgfail +} + +# non-multiarch or "ubuntus" old multiarchified dpkg +echo 'Dir::Bin::dpkg "./dpkg-wrapper";' > rootdir/etc/apt/apt.conf.d/99dpkgwrapper +echo '#! /bin/sh +if echo "$*" | grep -q -- "--assert-multi-arch"; then + return 2; +fi +return $*' > ./dpkg-wrapper +chmod +x ./dpkg-wrapper + +testqualifier 'native-pkg' 'native-pkg' +testqualifier 'native-pkg:amd64' 'native-pkg' +testqualifier 'foreign-pkg' 'foreign-pkg:i386' +testqualifier 'foreign-pkg:i386' 'foreign-pkg:i386' +testqualifier 'same-lib' 'same-lib' +testqualifier 'same-lib:amd64' 'same-lib' +testqualifier 'same-lib:i386' 'same-lib:i386' + +# multiarch dpkg (new interface version) + +echo 'Dir::Bin::dpkg "./dpkg-wrapper";' > rootdir/etc/apt/apt.conf.d/99dpkgwrapper +echo '#! /bin/sh +if echo "$*" | grep -q -- "--assert-multi-arch"; then + return 0; +fi +return $*' > ./dpkg-wrapper + +testqualifier 'native-pkg' 'native-pkg:amd64' +testqualifier 'native-pkg:amd64' 'native-pkg:amd64' +testqualifier 'foreign-pkg' 'foreign-pkg:i386' +testqualifier 'foreign-pkg:i386' 'foreign-pkg:i386' +testqualifier 'same-lib' 'same-lib:amd64' +testqualifier 'same-lib:amd64' 'same-lib:amd64' +testqualifier 'same-lib:i386' 'same-lib:i386' -- cgit v1.2.3