test-bug-624218-Translation-file-handling 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. #!/bin/sh
  2. set -e
  3. TESTDIR=$(readlink -f $(dirname $0))
  4. . $TESTDIR/framework
  5. setupenvironment
  6. configarchitecture 'i386'
  7. buildsimplenativepackage 'coolstuff' 'all' '1.0' 'unstable'
  8. setupaptarchive
  9. changetowebserver
  10. rm -rf rootdir/var/lib/apt/lists
  11. msgtest 'No download of non-existent locals' 'with Index'
  12. LC_ALL="" aptget update -o Acquire::Languages=en | grep -q -e 'Translation-[^e][^n] ' && msgfail || msgpass
  13. rm -rf rootdir/var/lib/apt/lists
  14. msgtest 'Download of existent locals' 'with Index'
  15. LC_ALL="" aptget update | grep -q -e 'Translation-en ' && msgpass || msgfail
  16. rm -rf rootdir/var/lib/apt/lists
  17. msgtest 'Download of en in LC_ALL=C' 'with Index'
  18. LC_ALL=C aptget update | grep -q -e 'Translation-en ' && msgpass || msgfail
  19. rm -rf rootdir/var/lib/apt/lists
  20. msgtest 'Download of en as forced language' 'with Index'
  21. aptget update -o Acquire::Languages=en | grep -q -e 'Translation-en ' && msgpass || msgfail
  22. rm -rf rootdir/var/lib/apt/lists
  23. msgtest 'Download of nothing else in forced language' 'with Index'
  24. aptget update -o Acquire::Languages=en | grep -q -e 'Translation-[^e][^n] ' && msgfail || msgpass
  25. rm -rf rootdir/var/lib/apt/lists
  26. msgtest 'Download no Translation- if forced language is non-existent' 'with Index'
  27. aptget update -o Acquire::Languages=ast_DE | grep -q -e 'Translation-' && msgfail || msgpass
  28. rm -rf rootdir/var/lib/apt/lists
  29. msgtest 'Download of nothing if none is forced' 'with Index'
  30. aptget update -o Acquire::Languages=none | grep -q -e 'Translation' && msgfail || msgpass
  31. rm -rf rootdir/var/lib/apt/lists
  32. sed -i '/i18n\/Translation-.*$/ d' $(find aptarchive -name 'Release')
  33. signreleasefiles
  34. msgtest 'Download of en as forced language' 'without Index'
  35. aptget update -o Acquire::Languages=en | grep -q -e 'Translation-en ' && msgpass || msgfail
  36. rm -rf rootdir/var/lib/apt/lists
  37. msgtest 'Download of nothing else in forced language' 'without Index'
  38. aptget update -o Acquire::Languages=en | grep -q -e 'Translation-[^e][^n] ' && msgfail || msgpass
  39. rm -rf rootdir/var/lib/apt/lists
  40. msgtest 'Download of ast_DE as forced language' 'without Index'
  41. aptget update -o Acquire::Languages=ast_DE | grep -q -e 'Translation-ast_DE$' && msgpass || msgfail
  42. rm -rf rootdir/var/lib/apt/lists
  43. msgtest 'Download of nothing else in forced language' 'without Index'
  44. aptget update -o Acquire::Languages=ast_DE | grep -q -e 'Translation-[^a][^s]' && msgfail || msgpass
  45. rm -rf rootdir/var/lib/apt/lists
  46. msgtest 'Download of nothing if none is forced' 'without Index'
  47. aptget update -o Acquire::Languages=none | grep -q -e 'Translation' && msgfail || msgpass
  48. rm -rf rootdir/var/lib/apt/lists
  49. mkdir -p rootdir/var/lib/apt/lists
  50. touch rootdir/var/lib/apt/lists/localhost:8080_dists_unstable_main_i18n_Translation-ast_DE
  51. msgtest 'Download of builtin files' 'without Index'
  52. aptget update | grep -q -e 'Translation-ast_DE' && msgpass || msgfail
  53. rm -rf rootdir/var/lib/apt/lists
  54. mkdir -p rootdir/var/lib/apt/lists
  55. touch rootdir/var/lib/apt/lists/localhost:8080_dists_unstable_main_i18n_Translation-ast_DE
  56. msgtest 'Download of nothing (even builtin) if none is forced' 'without Index'
  57. aptget update -o Acquire::Languages=none | grep -q -e 'Translation' && msgfail || msgpass
  58. rm -rf rootdir/var/lib/apt/lists