You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

93 lines
3.4 KiB

  1. #!/bin/sh
  2. set -e
  3. TESTDIR=$(readlink -f $(dirname $0))
  4. . $TESTDIR/framework
  5. setupenvironment
  6. configarchitecture "i386"
  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. echo "$PACKAGESTANZA
  22. Description: Advanced front-end for dpkg" > aptarchive/Packages
  23. echo "Package: apt
  24. Description-md5: d41ee493aa9fcc6cbc9ce4eb7069959c
  25. Description-${LOCALE}: Mächtige Oberfläche für dpkg
  26. Das Paket bietet dem Nutzer technisch führende Methoden für den Zugriff
  27. auf den dpkg-Paketmanager. Es beinhaltet das apt-get-Werkzeug und die
  28. APT-Dselect-Methode. Beides sind einfache und sicherere Wege,
  29. um Pakete zu installieren und Upgrades durchzuführen." | bzip2 > aptarchive/${LOCALE}.bz2
  30. # the $LOCALE translation file will not be included as it is a flat archive it came from and therefore
  31. # its name can not be guessed correctly… (in non-flat archives the files are called Translation-*)
  32. echo 'APT::Cache::Generate "false";' > rootdir/etc/apt/apt.conf.d/00nogenerate
  33. NOLONGSTANZA="$PACKAGESTANZA
  34. Description: Advanced front-end for dpkg
  35. "
  36. ENGLISHSTANZA="$PACKAGESTANZA
  37. Description: Advanced front-end for dpkg
  38. "
  39. LOCALESTANZA="$PACKAGESTANZA
  40. Description-${LOCALE}: Mächtige Oberfläche für dpkg
  41. Das Paket bietet dem Nutzer technisch führende Methoden für den Zugriff
  42. auf den dpkg-Paketmanager. Es beinhaltet das apt-get-Werkzeug und die
  43. APT-Dselect-Methode. Beides sind einfache und sicherere Wege,
  44. um Pakete zu installieren und Upgrades durchzuführen.
  45. "
  46. testrun() {
  47. echo "Acquire::Languages { \"${LOCALE}\"; \"en\"; };" > rootdir/etc/apt/apt.conf.d/00languages
  48. export LC_ALL=""
  49. rm -rf rootdir/var/lib/apt/lists
  50. setupaptarchive
  51. testequal "$LOCALESTANZA" aptcache show apt -o Test=File-${LOCALE}
  52. testequal "$NOLONGSTANZA" aptcache show apt -o Acquire::Languages="ww" -o Test=File-${LOCALE}
  53. testequal "$LOCALESTANZA" aptcache show apt -o Acquire::Languages::="ww" -o Test=File-${LOCALE}
  54. LC_ALL=C testequal "$ENGLISHSTANZA" aptcache show apt -o Test=File-${LOCALE}
  55. export LC_ALL=""
  56. echo "Acquire::Languages { \"ww\"; \"${LOCALE}\"; \"en\"; };" > rootdir/etc/apt/apt.conf.d/00languages
  57. testequal "$LOCALESTANZA" aptcache show apt -o Test=File-ww-${LOCALE}
  58. echo "Acquire::Languages { \"ww\"; \"en\"; };" > rootdir/etc/apt/apt.conf.d/00languages
  59. testequal "$ENGLISHSTANZA" aptcache show apt -o Test=File-ww
  60. }
  61. testrun
  62. echo "$PACKAGESTANZA
  63. Description: Advanced front-end for dpkg" > aptarchive/Packages
  64. echo "Package: apt
  65. Description-md5: d41ee493aa9fcc6cbc9ce4eb7069959c
  66. Description-en: Advanced front-end for dpkg
  67. This is Debian's next generation front-end for the dpkg package manager.
  68. It provides the apt-get utility and APT dselect method that provides a
  69. simpler, safer way to install and upgrade packages." | bzip2 > aptarchive/en.bz2
  70. ENGLISHSTANZA="$PACKAGESTANZA
  71. Description-en: Advanced front-end for dpkg
  72. This is Debian's next generation front-end for the dpkg package manager.
  73. It provides the apt-get utility and APT dselect method that provides a
  74. simpler, safer way to install and upgrade packages.
  75. "
  76. testrun