generate-locale-list.sh 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #!/bin/sh
  2. CLASSPATH_SRCDIR=`dirname $0`/..
  3. echo "/* LocaleData.java --"
  4. echo " Copyright (C) 2004, 2005 Free Software Foundation, Inc."
  5. echo
  6. echo "This file is part of GNU Classpath."
  7. echo
  8. echo "GNU Classpath is free software; you can redistribute it and/or modify"
  9. echo "it under the terms of the GNU General Public License as published by"
  10. echo "the Free Software Foundation; either version 2, or (at your option)"
  11. echo "any later version."
  12. echo
  13. echo "GNU Classpath is distributed in the hope that it will be useful, but"
  14. echo "WITHOUT ANY WARRANTY; without even the implied warranty of"
  15. echo "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU"
  16. echo "General Public License for more details."
  17. echo
  18. echo "You should have received a copy of the GNU General Public License"
  19. echo "along with GNU Classpath; see the file COPYING. If not, write to the"
  20. echo "Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA"
  21. echo "02110-1301 USA."
  22. echo
  23. echo "Linking this library statically or dynamically with other modules is"
  24. echo "making a combined work based on this library. Thus, the terms and"
  25. echo "conditions of the GNU General Public License cover the whole"
  26. echo "combination."
  27. echo
  28. echo "As a special exception, the copyright holders of this library give you"
  29. echo "permission to link this library with independent modules to produce an"
  30. echo "executable, regardless of the license terms of these independent"
  31. echo "modules, and to copy and distribute the resulting executable under"
  32. echo "terms of your choice, provided that you also meet, for each linked"
  33. echo "independent module, the terms and conditions of the license of that"
  34. echo "module. An independent module is a module which is not derived from"
  35. echo "or based on this library. If you modify this library, you may extend"
  36. echo "this exception to your version of the library, but you are not"
  37. echo "obligated to do so. If you do not wish to do so, delete this"
  38. echo "exception statement from your version. */"
  39. echo
  40. echo
  41. echo "package gnu.java.locale;"
  42. echo
  43. echo "// This file was automatically generated by scripts/generate-locale-list.sh"
  44. echo
  45. echo
  46. echo "class LocaleData"
  47. echo "{"
  48. echo " public static final String[] localeNames ="
  49. echo " {"
  50. ( cd $CLASSPATH_SRCDIR/resource/gnu/java/locale ; ls LocaleInformation_*.properties ) | xargs -n 1 echo | sed -e 's/LocaleInformation_\(.*\)\.properties/\1/' |
  51. while read locale ; do echo " \"$locale\"," ; done
  52. echo " };"
  53. echo
  54. echo " public static final String[] collatorLocaleNames ="
  55. echo " {"
  56. ( cd $CLASSPATH_SRCDIR/resource/gnu/java/locale; grep -l collation_rules LocaleInformation_*.properties) |
  57. xargs -n 1 echo | sed -e 's/LocaleInformation_\(.*\)\.properties/\1/' |
  58. sed -e '/^$/ d' |
  59. while read locale ; do echo " \"$locale\"," ; done
  60. echo " };"
  61. echo "}"