test-bug-601016-description-translation 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. #!/bin/sh
  2. set -e
  3. TESTDIR=$(readlink -f $(dirname $0))
  4. . $TESTDIR/framework
  5. setupenvironment
  6. configarchitecture 'i386' 'amd64'
  7. # we need a valid locale here, otherwise the language configuration
  8. # will be overridden by LC_ALL=C
  9. LOCALE="$(echo "$LANG" | cut -d'_' -f 1)"
  10. PACKAGESTANZA="Package: apt
  11. Priority: important
  12. Section: admin
  13. Installed-Size: 5984
  14. Maintainer: APT Development Team <deity@lists.debian.org>
  15. Architecture: i386
  16. Version: 0.8.7
  17. Filename: pool/main/a/apt/apt_0.8.7_i386.deb
  18. Size: 2140230
  19. MD5sum: 74769bfbcef9ebc4fa74f7a5271b9c08
  20. Description-md5: d41ee493aa9fcc6cbc9ce4eb7069959c"
  21. PACKAGESTANZA2='Package: apt
  22. Priority: important
  23. Section: admin
  24. Installed-Size: 5984
  25. Maintainer: APT Development Team <deity@lists.debian.org>
  26. Architecture: amd64
  27. Version: 0.8.7
  28. Filename: pool/main/a/apt/apt_0.8.7_amd64.deb
  29. Size: 2210342
  30. MD5sum: 4a869bfbdef9ebc9fa74f7a5271e8d1a
  31. Description-md5: d41ee493aa9fcc6cbc9ce4eb7069959c'
  32. echo "$PACKAGESTANZA
  33. Description: Advanced front-end for dpkg
  34. $PACKAGESTANZA2
  35. Description: Advanced front-end for dpkg" > aptarchive/Packages
  36. echo "Package: apt
  37. Description-md5: d41ee493aa9fcc6cbc9ce4eb7069959c
  38. Description-${LOCALE}: Mächtige Oberfläche für dpkg
  39. Das Paket bietet dem Nutzer technisch führende Methoden für den Zugriff
  40. auf den dpkg-Paketmanager. Es beinhaltet das apt-get-Werkzeug und die
  41. APT-Dselect-Methode. Beides sind einfache und sicherere Wege,
  42. um Pakete zu installieren und Upgrades durchzuführen." | bzip2 > aptarchive/${LOCALE}.bz2
  43. # the $LOCALE translation file will not be included as it is a flat archive it came from and therefore
  44. # its name can not be guessed correctly… (in non-flat archives the files are called Translation-*)
  45. echo 'APT::Cache::Generate "false";' > rootdir/etc/apt/apt.conf.d/00nogenerate
  46. NOLONGSTANZA="$PACKAGESTANZA
  47. Description: Advanced front-end for dpkg
  48. "
  49. ENGLISHSTANZA="$PACKAGESTANZA
  50. Description: Advanced front-end for dpkg
  51. "
  52. LOCALESTANZA="$PACKAGESTANZA
  53. Description-${LOCALE}: Mächtige Oberfläche für dpkg
  54. Das Paket bietet dem Nutzer technisch führende Methoden für den Zugriff
  55. auf den dpkg-Paketmanager. Es beinhaltet das apt-get-Werkzeug und die
  56. APT-Dselect-Methode. Beides sind einfache und sicherere Wege,
  57. um Pakete zu installieren und Upgrades durchzuführen.
  58. "
  59. LOCALESTANZA2="$PACKAGESTANZA2
  60. Description-${LOCALE}: Mächtige Oberfläche für dpkg
  61. Das Paket bietet dem Nutzer technisch führende Methoden für den Zugriff
  62. auf den dpkg-Paketmanager. Es beinhaltet das apt-get-Werkzeug und die
  63. APT-Dselect-Methode. Beides sind einfache und sicherere Wege,
  64. um Pakete zu installieren und Upgrades durchzuführen.
  65. "
  66. testrun() {
  67. echo "Acquire::Languages { \"${LOCALE}\"; \"en\"; };" > rootdir/etc/apt/apt.conf.d/00languages
  68. export LC_ALL=""
  69. rm -rf rootdir/var/lib/apt/lists
  70. setupaptarchive
  71. testequal "$LOCALESTANZA" aptcache show apt -o Test=File-${LOCALE}
  72. testequal "$LOCALESTANZA" aptcache show apt:i386 -o Test=File-${LOCALE}
  73. testequal "$LOCALESTANZA2" aptcache show apt:amd64 -o Test=File-${LOCALE}
  74. testequal "$NOLONGSTANZA" aptcache show apt -o Acquire::Languages="ww" -o Test=File-${LOCALE}
  75. testequal "$LOCALESTANZA" aptcache show apt -o Acquire::Languages::="ww" -o Test=File-${LOCALE}
  76. LC_ALL=C testequal "$ENGLISHSTANZA" aptcache show apt -o Test=File-${LOCALE}
  77. export LC_ALL=""
  78. echo "Acquire::Languages { \"ww\"; \"${LOCALE}\"; \"en\"; };" > rootdir/etc/apt/apt.conf.d/00languages
  79. testequal "$LOCALESTANZA" aptcache show apt -o Test=File-ww-${LOCALE}
  80. echo "Acquire::Languages { \"ww\"; \"en\"; };" > rootdir/etc/apt/apt.conf.d/00languages
  81. testequal "$ENGLISHSTANZA" aptcache show apt -o Test=File-ww
  82. }
  83. testrun
  84. echo "$PACKAGESTANZA
  85. Description: Advanced front-end for dpkg
  86. $PACKAGESTANZA2
  87. Description: Advanced front-end for dpkg" > aptarchive/Packages
  88. echo "Package: apt
  89. Description-md5: d41ee493aa9fcc6cbc9ce4eb7069959c
  90. Description-en: Advanced front-end for dpkg
  91. This is Debian's next generation front-end for the dpkg package manager.
  92. It provides the apt-get utility and APT dselect method that provides a
  93. simpler, safer way to install and upgrade packages." | bzip2 > aptarchive/en.bz2
  94. ENGLISHSTANZA="$PACKAGESTANZA
  95. Description-en: Advanced front-end for dpkg
  96. This is Debian's next generation front-end for the dpkg package manager.
  97. It provides the apt-get utility and APT dselect method that provides a
  98. simpler, safer way to install and upgrade packages.
  99. "
  100. ENGLISHSTANZA2="$PACKAGESTANZA2
  101. Description-en: Advanced front-end for dpkg
  102. This is Debian's next generation front-end for the dpkg package manager.
  103. It provides the apt-get utility and APT dselect method that provides a
  104. simpler, safer way to install and upgrade packages.
  105. "
  106. testrun