Bug 1869647 - Mark hasStorageAccess.sub.https.window.html as intermittent after wpt...
[gecko.git] / intl / icu / source / config / dist-data.sh
blob9406ebb3a6341e9c2ad88aff7ca1aabc47b7c031
1 #!/bin/bash
2 # Copyright (C) 2020 and later: Unicode, Inc. and others.
4 # set VERSION to the ICU version. set top_srcdir to the parent of icurc
5 # Note: You need to set LD_LIBRARY_PATH/etc before calling this script.
6 export LD_LIBRARY_PATH=./lib:${LD_LIBRARY_PATH-/lib:/usr/lib:/usr/local/lib}
7 export DYLD_LIBRARY_PATH=./lib:${DYLD_LIBRARY_PATH-/lib:/usr/lib:/usr/local/lib}
9 if [ ! -d "${top_srcdir}" ]
10 then
11 echo >&2 "$0: please set 'top_srcdir' to the icu/icu4c/source dir"
12 exit 1
14 LICENSE=${LICENSE-${top_srcdir}/../LICENSE}
16 if [ ! -f "${LICENSE}" ]
17 then
18 echo >&2 "$0: could not load license file ${LICENSE}"
19 exit 1
22 DATFILE=${DATFILE-$(ls data/out/tmp/icudt*.dat| head -1)}
24 if [ ! -f "${DATFILE}" ]
25 then
26 echo >&2 "$0: could not find DATFILE ${DATFILE}"
27 exit 1
30 # Short (major) version, i.e. 70
31 VERS=$(echo ${DATFILE} | tr -d a-z/.)
32 # Version number, i.e. 70.1
33 VERSION=${VERSION-unknown}
34 # Version number for files, i.e. 70_1
35 VERSION_FILE=$(echo ${VERSION} | tr . _)
37 if [[ "${VERSION}" = "unknown" ]];
38 then
39 VERSION=${VERS}.0
40 echo "$0: VERSION not set, using ${VERSION}"
41 else
42 if [[ "${VERS}" != $(echo ${VERSION} | cut -d. -f1) ]]
43 then
44 echo >&2 "$0: Warning: Expected version ${VERSION} to start with ${VERS}..."
48 # yeah, override ENDIANS if you want a different flavor.
49 #ENDIANS="b l e"
50 ENDIANS=${ENDIANS-"b l"}
51 DISTY_DIR=${DISTY_DIR-./dist/}
53 if [ ! -x ./bin/icupkg ]
54 then
55 echo >&2 "$0: could not find executable ./bin/icupkg"
56 exit 1
59 echo "# Packing ${DATFILE} into data zips in dist/ for version ${VERSION}"
60 mkdir -p ${DISTY_DIR}/tmp
62 for endian in $ENDIANS;
64 base=icu4c-${VERSION_FILE}-data-bin-${endian}.zip
65 filename=icudt${VERS}${endian}.dat
66 if [ -f ${DISTY_DIR}/${base} ];
67 then
68 echo ${DISTY_DIR}/${base} exists, skipping
69 continue
71 rm -f ${DISTY_DIR}/tmp/${filename}
72 echo ./bin/icupkg -t${endian} ${DATFILE} ${DISTY_DIR}/tmp/${filename}
73 ./bin/icupkg -t${endian} ${DATFILE} ${DISTY_DIR}/tmp/${filename}
74 README=icu4c-${VERSION_FILE}-data-bin-${endian}-README.md
75 cat >> ${DISTY_DIR}/tmp/${README} <<EOF
76 # ICU Data Zip for ${VERSION}
78 For information on Unicode ICU, see [http://icu-project.org](http://icu-project.org)
80 ## Contents
82 This .zip file contains:
84 - this README
85 - [LICENSE](./LICENSE)
86 - ${filename}
88 ## How to use this file
90 This file contains prebuilt data in form **${endian}**.
91 ("l" for Little Endian, "b" for Big Endian, "e" for EBCDIC.)
92 It may be used to simplify build and installation of ICU.
93 See [http://icu-project.org](http://icu-project.org) for further information.
95 ## License
97 See [LICENSE](./LICENSE).
99 > Copyright © 2016 and later Unicode, Inc. and others. All Rights Reserved.
100 Unicode and the Unicode Logo are registered trademarks
101 of Unicode, Inc. in the U.S. and other countries.
102 [Terms of Use and License](http://www.unicode.org/copyright.html)
105 zip -v -j ${DISTY_DIR}/${base} \
106 ${LICENSE} \
107 ${DISTY_DIR}/tmp/${README} \
108 ${DISTY_DIR}/tmp/${filename}
109 ls -lh ${DISTY_DIR}/${base}
110 done