File: init.cfg

package info (click to toggle)
gettext 0.23.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 168,104 kB
  • sloc: ansic: 532,579; sh: 68,252; perl: 28,011; makefile: 9,068; lisp: 3,184; yacc: 1,055; java: 615; cs: 589; cpp: 397; objc: 343; sed: 79; tcl: 63; xml: 40; pascal: 11; awk: 7; php: 7
file content (59 lines) | stat: -rw-r--r-- 2,347 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# This file extends the init.sh (provided by gnulib).

# Set environment variables for the tests.
. ../tests/init-env

prepare_locale_ ()
{
  # Solaris 11.[0-3] doesn't strip the CODESET part from the locale name,
  # when looking for a message catalog. E.g. when the locale is fr_FR.UTF-8,
  # on Solaris 11.[0-3] it looks for
  #   <LOCALEDIR>/fr_FR.UTF-8/LC_MESSAGES/<domain>.mo
  #   <LOCALEDIR>/fr.UTF-8/LC_MESSAGES/<domain>.mo
  # Similarly, on Solaris 11 OpenIndiana and Solaris 11 OmniOS it looks only for
  #   <LOCALEDIR>/fr_FR.UTF-8/LC_MESSAGES/<domain>.mo
  # Reported at <https://www.illumos.org/issues/13423>.
  # On Solaris 11.4 this is fixed: it looks for
  #   <LOCALEDIR>/fr_FR.UTF-8/LC_MESSAGES/<domain>.mo
  #   <LOCALEDIR>/fr.UTF-8/LC_MESSAGES/<domain>.mo
  #   <LOCALEDIR>/fr_FR/LC_MESSAGES/<domain>.mo
  #   <LOCALEDIR>/fr/LC_MESSAGES/<domain>.mo
  # Create a directory link with CODESET, to work around this.
  if test "$1" != "$2" && test "$GLIBC2" = no; then
    case "$host_os" in
      solaris2.11)
        # Copy the contents of "$1" into "$2", preserving the existing contents
        # of "$2".
        mkdir -p "$2"
        for d in `cd "$1" && find . -type d -print | grep -v '^[.]$' | sed -e 's|^[.]/||'`; do
          mkdir -p "$2/$d"
        done
        for f in `cd "$1" && find . -type f -print`; do
          if test -f "$2/$f"; then
            :
          else
            ln "$1/$f" "$2/$f"
          fi
        done
        ;;
    esac
  fi
}

# func_filter_POT_Creation_Date inputfile outputfile
# creates outputfile from inputfile, filtering out any 'POT-Creation-Date' line.
func_filter_POT_Creation_Date ()
{
  # A simple "grep -v 'POT-Creation-Date'" does not work:
  # - GNU grep 2.24 produces "Binary file (standard input) matches" in the
  #   output. The workaround is to use option '--text'.
  # - Similarly, OpenBSD 4.0 produces "Binary file (standard input) matches"
  #   in the output, but here it can be worked around by giving the input
  #   through a pipe.
  # - On native Windows, some 'grep' binaries produce CRLF line endings. Filter
  #   out the CRs a posteriori.
  cat "$1" | LC_ALL=C grep --text -v 'POT-Creation-Date' > "$1".tmq 2>/dev/null \
    || cat "$1" | LC_ALL=C grep -v 'POT-Creation-Date' > "$1".tmq \
    || Exit 1
  LC_ALL=C tr -d '\r' < "$1".tmq > "$2" || Exit 1
}