From 9169cd5049bd7f0d5dcc56c40d567a766cf5b851 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 26 Jan 2018 16:15:13 +0100 Subject: Extend apt build-dep pkg/release to switch dep as needed apt install pkg/release follows versioned dependencies in the candidate switching if the current candidate does not satisfy the dependency, so for uniformity the same should be supported in build-dep. --- test/integration/test-apt-source-and-build-dep | 59 ++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) (limited to 'test') diff --git a/test/integration/test-apt-source-and-build-dep b/test/integration/test-apt-source-and-build-dep index 7f7457217..24790a578 100755 --- a/test/integration/test-apt-source-and-build-dep +++ b/test/integration/test-apt-source-and-build-dep @@ -14,6 +14,10 @@ insertpackage 'wheezy' 'build-essential' 'all' '1.0' # a "normal" package with source and binary insertpackage 'unstable' 'foo' 'all' '2.0' insertsource 'unstable' 'foo' 'all' '2.0' +insertpackage 'unstable' 'foo-common' 'all' '2.0' 'Source: foo (2.0)' +insertpackage 'experimental' 'foo' 'all' '5' 'Depends: foo-common (= 5)' +insertpackage 'experimental' 'foo-common' 'all' '5' 'Source: foo (5)' +insertsource 'experimental' 'foo-source' 'all' '42' 'Build-Depends: foo (= 5), baz' # binary packages with Source-field insertpackage 'unstable,testing' 'bin' 'i386' '3-2+b1' 'Source: bin (3-2)' @@ -40,6 +44,8 @@ insertsource 'wheezy' 'foo' 'all' '0.1' insertsource 'stable' 'baz' 'all' '1.0' insertsource 'unstable' 'baz' 'all' '2.0' insertsource 'unstable' 'baz' 'all' '1.5' +insertpackage 'unstable' 'baz' 'all' '2.0' +insertpackage 'experimental' 'baz' 'all' '5.0' # ensure we really have the situation we wanted (first 2.0 is foo above) testequal 'Version: 2.0 @@ -189,3 +195,56 @@ Need to get 0 B/43 B of source archives. Fetch source bin-backport" apt source bin/stable -s -q testsuccessequal "$(getbuilddep 'bin-backport' "Picking 'bin-backport' as source package instead of 'bin' Selected version '2-2' (stable) for bin-backport")" apt build-dep bin/stable -s + +testsuccess apt install foo/experimental -s +testfailure apt build-dep foo-source -s +testsuccessequal "Reading package lists... +Selected version '42' (experimental) for foo-source +Reading package lists... +Building dependency tree... +Selected version '5' (experimental [all]) for 'foo' because of 'src:foo-source' +Selected version '5' (experimental [all]) for 'foo-common' because of 'foo' +The following NEW packages will be installed: + baz build-essential foo foo-common +0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded. +Inst baz (2.0 unstable [all]) +Inst build-essential (1.0 wheezy [all]) +Inst foo-common (5 experimental [all]) +Inst foo (5 experimental [all]) +Conf baz (2.0 unstable [all]) +Conf build-essential (1.0 wheezy [all]) +Conf foo-common (5 experimental [all]) +Conf foo (5 experimental [all])" apt build-dep foo-source/experimental -s +testsuccessequal "Reading package lists... +Selected version '42' (experimental) for foo-source +Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + baz build-essential foo foo-common +0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded. +Inst baz (5.0 experimental [all]) +Inst build-essential (1.0 wheezy [all]) +Inst foo-common (5 experimental [all]) +Inst foo (5 experimental [all]) +Conf baz (5.0 experimental [all]) +Conf build-essential (1.0 wheezy [all]) +Conf foo-common (5 experimental [all]) +Conf foo (5 experimental [all])" apt build-dep foo-source -t experimental -s +# this checks that mentioning the source pkg baz has no influence on the binary package baz +testsuccessequal "Reading package lists... +Selected version '42' (experimental) for foo-source +Selected version '2.0' (unstable) for baz +baz has no build depends. +Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + baz build-essential foo foo-common +0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded. +Inst baz (5.0 experimental [all]) +Inst build-essential (1.0 wheezy [all]) +Inst foo-common (5 experimental [all]) +Inst foo (5 experimental [all]) +Conf baz (5.0 experimental [all]) +Conf build-essential (1.0 wheezy [all]) +Conf foo-common (5 experimental [all]) +Conf foo (5 experimental [all])" apt build-dep foo-source baz/unstable -t experimental -s -- cgit v1.2.3 From ce9223cc4e4ffcc43d17ae97ff8c57fb759a2c49 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 26 Jan 2018 23:33:25 +0100 Subject: Support release selector for volatile files as well The syntax is a bit awkward, but it is the same as for a package name and introducing another syntax wouldn't really help usability, so with apt install ./foo.deb/experimental you will get the dependencies of foo satisfied by your default release, but if this wouldn't satisfy the version requirements the candidate for this dependency is switched to the version from the experimental release. The same applies for apt build-dep ./foo.dsc/stable-backports which was the initial request. --- test/integration/test-apt-install-file-reltag | 94 +++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100755 test/integration/test-apt-install-file-reltag (limited to 'test') diff --git a/test/integration/test-apt-install-file-reltag b/test/integration/test-apt-install-file-reltag new file mode 100755 index 000000000..afbf9bef9 --- /dev/null +++ b/test/integration/test-apt-install-file-reltag @@ -0,0 +1,94 @@ +#!/bin/sh +set -e + +TESTDIR="$(readlink -f "$(dirname "$0")")" +. "$TESTDIR/framework" + +setupenvironment +configarchitecture 'i386' + +insertpackage 'unstable' 'foo' 'all' '2' 'Depends: foo-common (= 2)' +insertpackage 'unstable' 'foo-common' 'all' '2' +insertpackage 'unstable' 'baz' 'all' '1' +insertpackage 'experimental' 'foo' 'all' '5' 'Depends: foo-common (= 5)' +insertpackage 'experimental' 'foo-common' 'all' '5' 'Source: foo (5)' +insertpackage 'experimental' 'baz' 'all' '2' +setupaptarchive + +insertinstalledpackage 'build-essential' 'all' '1' + +cat > foobar.dsc < +Build-Depends: foo (= 5), baz +Standards-Version: 4.1.3 +EOF +buildsimplenativepackage 'foobar2' 'all' '1' 'unstable' 'Depends: foo (= 5), baz' + +ln -s "$(readlink -f ./incoming/foobar2_1_all.deb)" foobar.deb +mkdir -p foobar +testfailuremsg 'E: Unable to correct problems, you have held broken packages.' apt build-dep "$(readlink -f ./foobar.dsc)" -s +testfailuremsg 'E: Unable to correct problems, you have held broken packages.' apt install "$(readlink -f ./foobar.deb)" -s +testfailuremsg 'E: Unable to correct problems, you have held broken packages.' apt build-dep ./foobar.dsc -s +testfailuremsg 'E: Unable to correct problems, you have held broken packages.' apt install ./foobar.deb -s +cd foobar +testfailuremsg 'E: Unable to correct problems, you have held broken packages.' apt build-dep ../foobar.dsc -s +testfailuremsg 'E: Unable to correct problems, you have held broken packages.' apt install ../foobar.deb -s +cd .. + +SUCCESSDSC='The following NEW packages will be installed: + baz foo foo-common +0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded. +Inst baz (1 unstable [all]) +Inst foo-common (5 experimental [all]) +Inst foo (5 experimental [all]) +Conf baz (1 unstable [all]) +Conf foo-common (5 experimental [all]) +Conf foo (5 experimental [all])' +SUCCESSDEB='The following additional packages will be installed: + baz foo foo-common +The following NEW packages will be installed: + baz foo foo-common foobar2 +0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded. +Inst baz (1 unstable [all]) +Inst foo-common (5 experimental [all]) +Inst foo (5 experimental [all]) +Inst foobar2 (1 local-deb [all]) +Conf baz (1 unstable [all]) +Conf foo-common (5 experimental [all]) +Conf foo (5 experimental [all]) +Conf foobar2 (1 local-deb [all])' +testsuccessequal "Note, using file '$(readlink -f ./foobar.dsc)' to get the build dependencies +$SUCCESSDSC" apt build-dep "$(readlink -f ./foobar.dsc)/experimental" -s -q=2 +testsuccessequal "Reading package lists... +Building dependency tree... +Note, selecting 'foobar2' instead of '$(readlink -f ./foobar.deb)' +$SUCCESSDEB" apt install "$(readlink -f ./foobar.deb)/experimental" -s +testsuccessequal "Note, using file './foobar.dsc' to get the build dependencies +$SUCCESSDSC" apt build-dep ./foobar.dsc/experimental -sq=2 +testsuccessequal "Reading package lists... +Building dependency tree... +Note, selecting 'foobar2' instead of './foobar.deb' +$SUCCESSDEB" apt install "./foobar.deb/experimental" -s +cd foobar +testsuccessequal "Note, using file '../foobar.dsc' to get the build dependencies +$SUCCESSDSC" apt build-dep ../foobar.dsc/experimental -sqq +testsuccessequal "Reading package lists... +Building dependency tree... +Note, selecting 'foobar2' instead of '../foobar.deb' +$SUCCESSDEB" apt install "../foobar.deb/experimental" -s +cd .. + +msgmsg 'fail with' 'incorrect release' +testfailuremsg 'E: Unable to correct problems, you have held broken packages.' apt build-dep "$(readlink -f ./foobar.dsc)/stable" -s +testfailuremsg 'E: Unable to correct problems, you have held broken packages.' apt install "$(readlink -f ./foobar.deb)/stable" -s +testfailuremsg 'E: Unable to correct problems, you have held broken packages.' apt build-dep ./foobar.dsc/stable -s +testfailuremsg 'E: Unable to correct problems, you have held broken packages.' apt install ./foobar.deb/stable -s +cd foobar +testfailuremsg 'E: Unable to correct problems, you have held broken packages.' apt build-dep ../foobar.dsc/stable -s +testfailuremsg 'E: Unable to correct problems, you have held broken packages.' apt install ../foobar.deb/stable -s +cd .. -- cgit v1.2.3 From bf53f39c9a0221b670ffff74053ed36fc502d5a0 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 11 Apr 2018 12:59:06 +0200 Subject: Support --with-source in show & search commands --- test/integration/test-apt-get-install-deb | 36 +++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) (limited to 'test') diff --git a/test/integration/test-apt-get-install-deb b/test/integration/test-apt-get-install-deb index 36e94a2dc..ff103a514 100755 --- a/test/integration/test-apt-get-install-deb +++ b/test/integration/test-apt-get-install-deb @@ -8,20 +8,26 @@ setupenvironment configarchitecture 'amd64' 'i386' # regression test for #754904 -testfailureequal 'E: Unsupported file /dev/null given on commandline' aptget install -qq /dev/null - -# only consider .deb files cat > foo.rpm < rootdir/etc/apt/preferences.d/pinit testsuccess aptget install ./incoming/pkg-as-it-should-be_0_all.deb testsuccess aptget install "$(readlink -f ./incoming/pkg-leading-newline_0_all.deb)" testsuccess aptget install ./incoming/pkg-trailing-newline_0_all.deb +testsuccess aptget install ./incoming/pkg-double-trailing-newline_0_all.deb testempty apt clean if [ "$(id -u)" = '0' ]; then -- cgit v1.2.3 From 6085ab7488326cfed8f82e07eefcbc2dc40d4bea Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 12 Apr 2018 09:59:47 +0200 Subject: Support local files as arguments in show command Now that --with-source is supported in show we can go a little further and add the "syntactic sugar" of supporting deb-files on the commandline directly to give users an alternative to remembering dpkg -I for deb files & as a bonus apt also works on changes files. Most of the code churn is actually to deal with cases probably not too common in reality like mixing packages and deb-files on the commandline and getting the right order for these multiple records. Closes: 883206 --- test/integration/test-apt-get-install-deb | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) (limited to 'test') diff --git a/test/integration/test-apt-get-install-deb b/test/integration/test-apt-get-install-deb index ff103a514..844f1d7c5 100755 --- a/test/integration/test-apt-get-install-deb +++ b/test/integration/test-apt-get-install-deb @@ -48,16 +48,37 @@ E: Unable to correct problems, you have held broken packages." aptget install ./ testsuccess apt show foo --with-source ./incoming/foo_1.0_amd64.deb testequal 'Package: foo -Version: 1.0' head -n 2 rootdir/tmp/testsuccess.output +Version: 1.0' grep -e '^Package:' -e '^Version:' -e '^Architecture:' rootdir/tmp/testsuccess.output +testsuccess apt show ./incoming/foo_1.0_amd64.deb +testequal 'Package: foo +Version: 1.0' grep -e '^Package:' -e '^Version:' -e '^Architecture:' rootdir/tmp/testsuccess.output +testsuccess apt show foo:i386 ./incoming/foo_1.0_amd64.deb --with-source ./incoming/foo_1.0_i386.deb +testequal 'Package: foo:i386 +Version: 1.0 +Package: foo +Version: 1.0' grep -e '^Package:' -e '^Version:' -e '^Architecture:' rootdir/tmp/testsuccess.output + +testsuccess aptcache show foo --with-source ./incoming/foo_1.0_amd64.deb +testequal 'Package: foo +Version: 1.0 +Architecture: amd64' grep -e '^Package:' -e '^Version:' -e '^Architecture:' rootdir/tmp/testsuccess.output +testsuccess aptcache show ./incoming/foo_1.0_amd64.deb +testequal 'Package: foo +Version: 1.0 +Architecture: amd64' grep -e '^Package:' -e '^Version:' -e '^Architecture:' rootdir/tmp/testsuccess.output +testsuccess aptcache show foo:i386 ./incoming/foo_1.0_amd64.deb --with-source ./incoming/foo_1.0_i386.deb +testequal 'Package: foo +Version: 1.0 +Architecture: i386 +Package: foo +Version: 1.0 +Architecture: amd64' grep -e '^Package:' -e '^Version:' -e '^Architecture:' rootdir/tmp/testsuccess.output + testsuccessequal 'Sorting... Full Text Search... foo/local-deb 1.0 amd64 an autogenerated dummy foo=1.0/unstable ' apt search foo --with-source ./incoming/foo_1.0_amd64.deb - -testsuccess aptcache show foo --with-source ./incoming/foo_1.0_amd64.deb -testequal 'Package: foo -Version: 1.0' head -n 2 rootdir/tmp/testsuccess.output testsuccessequal 'foo - an autogenerated dummy foo=1.0/unstable' aptcache search foo --with-source ./incoming/foo_1.0_amd64.deb testdpkgnotinstalled 'foo' 'foo:i386' -- cgit v1.2.3