PageRenderTime 43ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/Sources/selp_glibc-2.5.90-19.0.46/localedata/gen-locale.sh

https://bitbucket.org/Mali_Laurent/ps50c550
Shell | 52 lines | 25 code | 7 blank | 20 comment | 1 complexity | 0bb9838d7921d445842e9a8bf2f46b8b MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.0, LGPL-2.1, AGPL-1.0, CC-BY-SA-3.0, BSD-3-Clause
  1. #! /bin/sh
  2. # Generate test locale files.
  3. # Copyright (C) 2000,01,02 Free Software Foundation, Inc.
  4. # This file is part of the GNU C Library.
  5. #
  6. # The GNU C Library is free software; you can redistribute it and/or
  7. # modify it under the terms of the GNU Lesser General Public
  8. # License as published by the Free Software Foundation; either
  9. # version 2.1 of the License, or (at your option) any later version.
  10. # The GNU C Library is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. # Lesser General Public License for more details.
  14. # You should have received a copy of the GNU Lesser General Public
  15. # License along with the GNU C Library; if not, write to the Free
  16. # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  17. # 02111-1307 USA.
  18. common_objpfx="$1"; shift
  19. localedef="$1"; shift
  20. locfile="$1"; shift
  21. generate_locale ()
  22. {
  23. charmap=$1
  24. input=$2
  25. out=$3
  26. if I18NPATH=. GCONV_PATH=${common_objpfx}iconvdata \
  27. ${localedef} --quiet -c -f $charmap -i $input \
  28. ${common_objpfx}localedata/$out
  29. then
  30. # The makefile checks the timestamp of the LC_CTYPE file,
  31. # but localedef won't have touched it if it was able to
  32. # hard-link it to an existing file.
  33. touch ${common_objpfx}localedata/$out/LC_CTYPE
  34. else
  35. echo "Charmap: \"${charmap}\" Inputfile: \"${input}\"" \
  36. "Outputdir: \"${out}\" failed"
  37. exit 1
  38. fi
  39. }
  40. locfile=`echo $locfile|sed 's|.*/\([^/]*/LC_CTYPE\)|\1|'`
  41. locale=`echo $locfile|sed 's|\([^.]*\)[.].*/LC_CTYPE|\1|'`
  42. charmap=`echo $locfile|sed 's|[^.]*[.]\(.*\)/LC_CTYPE|\1|'`
  43. echo "Generating locale $locale.$charmap: this might take a while..."
  44. generate_locale `echo $charmap | sed -e s/SJIS/SHIFT_JIS/` $locale \
  45. $locale.$charmap