ctype.sh revision 017c01f878134ff71877f2c67cca171a4ad2cd93
#
#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source. A copy of the CDDL is also available via the Internet at
#
#
# Copyright 2011 Nexenta Systems, Inc. All rights reserved.
#
# Combine LC_CTYPE classes from all .UTF-8.src files to be compiled by localedef
# mapping tables, character classes, etc. for all of them. This is not general
# purpose parser but is good enough for the stock files supplied with CLDR.
printf "\nLC_CTYPE\n"
# sed can't match both range patterns on the same line so we just make
# it look like valid multiline class by duplicating the definition
sed -E "/^$i.*>$/ {
s,$,;/,
h
s,^$i(.*>);/$,\1,
H
x
}" $@ |\
sed -E -n "/^$i/,/(>|\))$/ {
s,^$i,,
s,(>|\))$,\1;/,
/^$/d
p
}" |\
sort -u |\
sed -E "1 s,^,$i,;$ s,(>|\));/,\1,"
done
printf "\nEND LC_CTYPE\n"