| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- #!/bin/sh
- set -e
- TESTDIR=$(readlink -f $(dirname $0))
- . $TESTDIR/framework
- setupenvironment
- configarchitecture "i386" "amd64"
- # different version for the individual arches
- insertpackage 'stable' 'foo' 'amd64' '1.0'
- insertsource 'stable' 'foo' 'amd64' '1.0'
- insertpackage 'stable' 'foo' 'i386' '1.0'
- insertsource 'stable' 'foo' 'i386' '1.0'
- insertpackage 'stable' 'foo' 'i386' '2.0'
- insertsource 'stable' 'foo' 'i386' '2.0'
- insertpackage 'oldstable' 'foo' 'i386' '0.1'
- insertsource 'oldstable' 'foo' 'i386' '0.1'
- # just needed so that there is a release file entry for the test
- insertpackage 'oldstable' 'unreleated' 'amd64' '0.1'
- setupaptarchive
- APTARCHIVE=$(readlink -f ./aptarchive)
- HEADER="Reading package lists...
- Building dependency tree..."
- DOWNLOAD10="Need to get 0 B/25 B of source archives.
- 'file://${APTARCHIVE}/foo_1.0.dsc' foo_1.0.dsc 11 MD5Sum:b998e085e36cf162e6a33c2801318fef
- 'file://${APTARCHIVE}/foo_1.0.tar.gz' foo_1.0.tar.gz 14 MD5Sum:d46b9a02af8487cbeb49165540c88184"
- # pick :amd64
- testsuccessequal "$HEADER
- $DOWNLOAD10" aptget source -q --print-uris foo:amd64
- # pick :i386
- testsuccessequal "$HEADER
- Need to get 0 B/25 B of source archives.
- 'file://${APTARCHIVE}/foo_2.0.dsc' foo_2.0.dsc 11 MD5Sum:c0de572c6f8aa576c8ff78c81132ed55
- 'file://${APTARCHIVE}/foo_2.0.tar.gz' foo_2.0.tar.gz 14 MD5Sum:e10bb487c375b2b938d27bd31c2d1f5f" aptget source -q --print-uris foo:i386
- # pick :i386 by release
- testsuccessequal "$HEADER
- Selected version '0.1' (oldstable) for foo
- Need to get 0 B/25 B of source archives.
- 'file://${APTARCHIVE}/foo_0.1.dsc' foo_0.1.dsc 11 MD5Sum:0811a4d85238056c613ea897f49f01af
- 'file://${APTARCHIVE}/foo_0.1.tar.gz' foo_0.1.tar.gz 14 MD5Sum:fa1ecb7a1a53e8e6f6551ca7db888a61" aptget source -q --print-uris foo:i386/oldstable
- # pick :i386 by version
- testsuccessequal "$HEADER
- $DOWNLOAD10" aptget source -q --print-uris foo:i386=1.0
- # error on unknown arch
- testfailureequal "$HEADER
- E: Can not find a package for architecture 'not-a-available-arch'
- E: Unable to find a source package for foo:not-a-available-arch" aptget source -q --print-uris foo:not-a-available-arch
- # error on unavailable version for arch
- testfailureequal "$HEADER
- E: Can not find a package 'foo:amd64' with version '2.0'
- E: Unable to find a source package for foo:amd64=2.0" aptget source -q --print-uris foo:amd64=2.0
- # error on unavailable release for arch
- testfailureequal "$HEADER
- E: Can not find a package 'foo:amd64' with release 'oldstable'
- E: Unable to find a source package for foo:amd64/oldstable" aptget source -q --print-uris foo:amd64/oldstable
|