set -u . "$TESTSDIR"/test.inc # First test if finding the binaries works properly... testrun - --lunzip=NONE --unxz=NONE __dumpuncompressors 3< testfile dd if=/dev/zero bs=1024 count=1024 >> testfile echo "" >> testfile echo "middle" >> testfile dd if=/dev/zero bs=1024 count=1024 >> testfile echo "" >> testfile echo "end" >> testfile echo "Ohm" > smallfile echo gzip -c testfile \> testfile.gz gzip -c testfile > testfile.gz echo bzip2 -c testfile \> testfile.bz2 bzip2 -c testfile > testfile.bz2 echo lzma -c testfile \> testfile.lzma lzma -c testfile > testfile.lzma if test -x /usr/bin/xz ; then echo xz -c testfile \> testfile.xz xz -c testfile > testfile.xz fi echo gzip -c smallfile \> smallfile.gz gzip -c smallfile > smallfile.gz echo bzip2 -c smallfile \> smallfile.bz2 bzip2 -c smallfile > smallfile.bz2 echo lzma -c smallfile \> smallfile.lzma lzma -c smallfile > smallfile.lzma if test -x /usr/bin/xz ; then echo xz -c smallfile \> smallfile.xz xz -c smallfile > smallfile.xz testrun - __uncompress .xz testfile.xz testfile.xz.uncompressed 3< smallfile.lzma.uncompressed exited with errorcode 1! -v0*=There have been errors! returns 255 EOF dodo test ! -e smallfile.lzma.uncompressed # Now check for compressed parts of an .a file: cat > control < control.tar.bz2 tar -cf - ./control | bzip2 > control.tar.bz2 rm control echo tar -cf - testfile\* \| lzma \> data.tar.lzma tar -cf - testfile* | lzma > data.tar.lzma echo 2.0 > debian-binary dodo ar qcfS fake.deb debian-binary control.tar.bz2 data.tar.lzma rm *.tar.bz2 *.tar.lzma debian-binary # TODO: there could be a problem here with .deb files that have data after the # ./control file in data.tar and using an external uncompressor. # But how to test this when there is no way to trigger it in the default built? testrun - __extractcontrol fake.deb 3< debian/control < debian/dirs dd if=/dev/zero of=debian/zzz bs=1024 count=4096 tar -cf - debian | lzma > fake_1-1.debian.tar.lzma mkdir fake-1 mkdir fake-1.orig cp -al debian fake-1/debian cp -al debian fake-1.orig/debian sed -e 's/1/2/' fake-1/debian/dirs > fake-1/debian.dirs.new mv fake-1/debian.dirs.new fake-1/debian/dirs diff -ruN fake-1.orig fake-1 | lzma > fake_1-1.diff.lzma rm -r debian # .debian.tar and .diff usually do not happen at the same time, but easier testing... cat > fake_1-1.dsc << EOF Format: 3.0 Source: fake Binary: abinary Architecture: all Version: 17 Maintainer: Me Files: $(mdandsize fake_1-1.diff.lzma) fake_1-1.diff.lzma $(mdandsize fake_1-1.debian.tar.lzma) fake_1-1.debian.tar.lzma 00000000000000000000000000000000 0 fake_1.orig.tar.lzma EOF testrun - __extractsourcesection fake_1-1.dsc 3< fake_1-1.debian.tar.lzma tar -cf - debian | lzma > fake_1-1.debian.tar.lzma rm -r debian testrun - __extractsourcesection fake_1-1.dsc 3< fake-1/debian/control < fake-1/debian/aaaaa < fake_1-1.diff.lzma rm -r fake-1 fake-1.orig cat > fake_1-1.dsc << EOF Format: 3.0 Source: fake Binary: abinary Architecture: all Version: 17 Maintainer: Me Files: $(mdandsize fake_1-1.diff.lzma) fake_1-1.diff.lzma $(mdandsize fake_1-1.debian.tar.lzma) fake_1-1.debian.tar.lzma 00000000000000000000000000000000 0 fake_1.orig.tar.lzma EOF testrun - __extractsourcesection fake_1-1.dsc 3< fake_1-2.diff < fake_1-2.dsc << EOF Format: 3.0 Source: fake Binary: abinary Architecture: all Version: 17 Maintainer: Me Files: $(mdandsize fake_1-2.diff.gz) fake_1-2.diff.gz 00000000000000000000000000000000 0 fake_1.orig.tar.gz EOF testrun - __extractsourcesection fake_1-2.dsc 3<