X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/7e7cf2734543ee32401c0308e582406d2c9a28ec..da029b0aaebdc64a3a9f6b7012213539421c934b:/test/integration/test-apt-cdrom diff --git a/test/integration/test-apt-cdrom b/test/integration/test-apt-cdrom index cc3483f9b..8d8fdf167 100755 --- a/test/integration/test-apt-cdrom +++ b/test/integration/test-apt-cdrom @@ -12,31 +12,60 @@ setupaptarchive --no-update changetocdrom 'Debian APT Testdisk 0.8.15' # -de is not in the Release file, but picked up anyway for compatibility -cd rootdir/media/cdrom/dists/stable/main/i18n +cd rootdir/media/cdrom-unmounted/dists/stable/main/i18n +chmod +w . sed -e '/^Description-en:/ d' -e '/^ / d' -e '/^$/ d' Translation-en > Translation-de echo 'Description-de: automatisch generiertes Testpaket testing=0.8.15/stable Diese Pakete sind nur für das testen von APT gedacht, sie erfüllen keinen Zweck auf einem normalen System… ' >> Translation-de compressfile Translation-de -rm Translation-en Translation-de +rm -f Translation-en Translation-de +chmod -R -w . cd - > /dev/null -addtrap 'prefix' "chmod -R +w $PWD/rootdir/media/cdrom/dists/;" -chmod -R -w rootdir/media/cdrom/dists -aptcdrom add -m -o quiet=1 > apt-cdrom.log 2>&1 -sed -i -e '/^Using CD-ROM/ d' -e '/gpgv/ d' -e '/^Identifying/ d' -e '/Reading / d' apt-cdrom.log -testfileequal apt-cdrom.log "Scanning disc for index files.. -Found 2 package indexes, 1 source indexes, 1 translation indexes and 1 signatures -Found label 'Debian APT Testdisk 0.8.15' -This disc is called: +aptcdromlog() { + rm -f rootdir/tmp/apt-cdrom.log + test ! -e rootdir/media/cdrom || echo "CD-ROM is mounted, but shouldn't be!" + test -e rootdir/media/cdrom-unmounted || echo "Unmounted CD-ROM doesn't exist, but it should!" + aptcdrom "$@" -o quiet=1 >rootdir/tmp/apt-cdrom.log 2>&1 apt-cdrom.log 2>&1 -sed -i -e '/^Using CD-ROM/ d' -e '/gpgv/ d' -e '/^Identifying/ d' -e '/Reading / d' apt-cdrom.log -testfileequal apt-cdrom.log "Scanning disc for index files.. +testequal "$CDROM_PRE Found 2 package indexes, 1 source indexes, 2 translation indexes and 1 signatures -This disc is called: -'Debian APT Testdisk 0.8.15' -Writing new source list -Source list entries for this disc are: -deb cdrom:[Debian APT Testdisk 0.8.15]/ stable main -deb-src cdrom:[Debian APT Testdisk 0.8.15]/ stable main -Repeat this process for the rest of the CDs in your set." +$CDROM_POST" aptcdromlog add -o APT::CDROM::DropTranslation=0 # take Translations from previous runs as needed -aptcdrom add -m -o quiet=1 > apt-cdrom.log 2>&1 -sed -i -e '/^Using CD-ROM/ d' -e '/gpgv/ d' -e '/^Identifying/ d' -e '/Reading / d' apt-cdrom.log -testfileequal apt-cdrom.log "Scanning disc for index files.. +testequal "$CDROM_PRE Found 2 package indexes, 1 source indexes, 2 translation indexes and 1 signatures -This disc is called: -'Debian APT Testdisk 0.8.15' -Writing new source list -Source list entries for this disc are: -deb cdrom:[Debian APT Testdisk 0.8.15]/ stable main -deb-src cdrom:[Debian APT Testdisk 0.8.15]/ stable main -Repeat this process for the rest of the CDs in your set." +$CDROM_POST" aptcdromlog add msgtest 'Test for the german description translation of' 'testing' aptcache show testing -o Acquire::Languages=de | grep -q '^Description-de: ' && msgpass || msgfail rm -rf rootdir/var/lib/apt/lists mkdir -p rootdir/var/lib/apt/lists/partial -aptcdrom add -m -o quiet=1 > apt-cdrom.log 2>&1 -sed -i -e '/^Using CD-ROM/ d' -e '/gpgv/ d' -e '/^Identifying/ d' -e '/Reading / d' apt-cdrom.log -testfileequal apt-cdrom.log "Scanning disc for index files.. +testequal "$CDROM_PRE Found 2 package indexes, 1 source indexes, 1 translation indexes and 1 signatures -This disc is called: -'Debian APT Testdisk 0.8.15' -Writing new source list -Source list entries for this disc are: -deb cdrom:[Debian APT Testdisk 0.8.15]/ stable main -deb-src cdrom:[Debian APT Testdisk 0.8.15]/ stable main -Repeat this process for the rest of the CDs in your set." +$CDROM_POST" aptcdromlog add msgtest 'Test for the english description translation of' 'testing' aptcache show testing -o Acquire::Languages=en | grep -q '^Description-en: ' && msgpass || msgfail - # check that we really can install from a 'cdrom' testdpkgnotinstalled testing testsuccess aptget install testing -y