diff options
author | 2020-05-25 12:41:15 +0200 | |
---|---|---|
committer | 2020-05-25 12:41:15 +0200 | |
commit | 1feb7c2887f1e257506a1577cd3f3f4d28e12ace (patch) | |
tree | 473e786e35a161991d07be6822f6f984c9bc2f06 /tests | |
parent | qmerge: use libq/tree for binpkg/Packages needs (diff) | |
download | portage-utils-1feb7c2887f1e257506a1577cd3f3f4d28e12ace.tar.gz portage-utils-1feb7c2887f1e257506a1577cd3f3f4d28e12ace.tar.bz2 portage-utils-1feb7c2887f1e257506a1577cd3f3f4d28e12ace.zip |
tests: add qmerge tests for different compression schemes in binpkgs
While we had support for installing various compressed binpkgs, we never
tested this at all. Especially since zstd now became the new standard
Portage uses, it is a good idea to ensure we cope well with this.
This new blob of tests, checks qtbz2, qlist and qmerge to disassemble,
assemble and install binpkgs with all known supported compressors.
Signed-off-by: Fabian Groffen <grobian@gentoo.org>
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/qmerge/dotest | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/tests/qmerge/dotest b/tests/qmerge/dotest index 208bc3b..59f249d 100755 --- a/tests/qmerge/dotest +++ b/tests/qmerge/dotest @@ -130,8 +130,42 @@ out=$(yes | qmerge -FU qmerge-test) tend $? "qmerge-test: [M] uninstall" || die "${out}" [[ ! -e ${ROOT}/usr/bin/qmerge-test ]] tend $? "qmerge-test: [M] /usr/bin/qmerge-test removed" || die "$(treedir "${ROOT}")" -set -e + +# try all compressions we know to see if we handle them properly +pkgver=qmerge-test-1.3 +rev=0 +mkdir -p pkgs/sys-devel +qtbz2 -s ${PKGDIR}/sys-devel/${pkgver}.tbz2 +export PKGDIR=${PWD}/pkgs +bzip2 -dc < ${pkgver}.tar.bz2 > ${pkgver}.tar +for compr in "" brotli gzip bzip2 xz lz4 zstd lzip lzop ; do + if [[ ${compr} != "" ]] ; then + cexec=$(type -P ${compr} 2>/dev/null) + echo "compressor: ${compr} = ${cexec}" + [[ -x ${cexec} ]] || continue + f=${pkgver}.tar.${compr} + ${cexec} -c < ${pkgver}.tar > ${f} + else + echo "plain tar" + f=${pkgver}.tar + fi + : $((rev++)) + qtbz2 -j ${f} ${pkgver}.xpak pkgs/sys-devel/${pkgver}-r${rev}.tbz2 + ls -l pkgs/sys-devel/${pkgver}-r${rev}.tbz2 + ROOT=/ qlist -kIv | tee /dev/stderr | wc -l + + # see if we can install this package + out=$(yes | qmerge -Fv qmerge-test) + tend $? "qmerge-test: [X] install ${pkgver}-r${rev}" || die "${out}" + qlist -Iv + out=$(yes | qmerge -FU qmerge-test) + tend $? "qmerge-test: [X] uninstall ${pkgver}-r${rev}" || die "${out}" + + rm pkgs/sys-devel/${pkgver}-r${rev}.tbz2 +done cleantmpdir +set -e + end |