1
0
Fork 0
apt/test/integration/test-apt-cache-showsrc
Daniel Baumann 6810ba718b
Adding upstream version 3.0.2.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-20 21:10:43 +02:00

37 lines
1.1 KiB
Bash
Executable file

#!/bin/sh
set -e
TESTDIR="$(readlink -f "$(dirname "$0")")"
. "$TESTDIR/framework"
setupenvironment
configarchitecture "i386"
# we have a foo source package
insertsource 'unstable' 'foo' 'all' '1.0' '' 'foo-binary'
# and a similar one that builds a foo binary package
insertsource 'unstable' 'unrelated' 'all' '1.0' '' 'foo'
# just here to workaround the need for a authenticated package
insertpackage 'unstable' 'workaround' 'all' '1.0'
setupaptarchive
# by default apt-cache showsrc will look into "binary" and "source" names
# and show all matches
aptcache showsrc foo > output.txt
testsuccess grep "Package: foo" output.txt
testsuccess grep "Package: unrelated" output.txt
# by default apt-cache showsrc will look into "binary" and "source" names
# and show all matches
aptcache showsrc --only-source foo > output.txt
testsuccess grep "Package: foo" output.txt
testfailure grep "Package: unrelated" output.txt
# by default apt-cache showsrc will look into "binary" and "source" names
# and show all matches
aptcache showsrc src:foo > output.txt
testsuccess grep "Package: foo" output.txt
testfailure grep "Package: unrelated" output.txt