Skip to content

Commit e16964e

Browse files
srl295MylesBorins
authored andcommitted
deps: minor ICU fixes: maint docs/tool, downloader
- Docs used the word "copy" when it really meant a tool is needed. - README-FULL-ICU.txt was generated in binary mode, but it's a text file. This breaks on Python3 for maintaining ICU - The ICU downloader was broken (also probably python3). It's basically dead code since 1a25e90 landed (full icu in repo), unless someone deleted the deps/icu-small directory from their repo. Co-Authored-By: Christian Clauss <cclauss@me.com> PR-URL: #32347 Reviewed-By: Ujjwal Sharma <ryzokuken@disroot.org> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Christian Clauss <cclauss@me.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
1 parent 8ea5ffc commit e16964e

File tree

3 files changed

+11
-13
lines changed

3 files changed

+11
-13
lines changed

doc/guides/maintaining-icu.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ new Intl.DateTimeFormat('es', { month: 'long' }).format(new Date(9E8));
9797

9898
…Should return `enero` not `January`.
9999

100-
* Now, copy `deps/icu` over to `deps/icu-small`
100+
* Now, run the shrink tool to update `deps/icu-small` from `deps/icu`
101101

102102
> :warning: Do not modify any source code in `deps/icu-small` !
103103
> See section below about floating patches to ICU.

tools/configure.d/nodedownload.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def checkHash(targetfile, hashAlgo):
6363
digest = hashlib.new(hashAlgo)
6464
with open(targetfile, 'rb') as f:
6565
chunk = f.read(1024)
66-
while chunk != "":
66+
while len(chunk) > 0:
6767
digest.update(chunk)
6868
chunk = f.read(1024)
6969
return digest.hexdigest()

tools/icu/shrink-icu-src.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -128,14 +128,12 @@ def icu_info(icu_full_path):
128128
readme_name = os.path.join(options.icudst, "README-FULL-ICU.txt" )
129129

130130
# Now, print a short notice
131-
fi = open(readme_name, 'wb')
132-
print("ICU sources - auto generated by shrink-icu-src.py", file=fi)
133-
print("", file=fi)
134-
print("This directory contains the ICU subset used by --with-intl=full-icu", file=fi)
135-
print("It is a strict subset of ICU %s source files with the following exception(s):" % (icu_ver_major), file=fi)
136-
print("* %s : compressed data file" % (dst_cmp_datafile), file=fi)
137-
print("", file=fi)
138-
print("", file=fi)
139-
print("To rebuild this directory, see ../../tools/icu/README.md", file=fi)
140-
print("", file=fi)
141-
fi.close()
131+
msg_fmt = """\
132+
ICU sources - auto generated by shrink-icu-src.py\n
133+
This directory contains the ICU subset used by --with-intl=full-icu
134+
It is a strict subset of ICU {} source files with the following exception(s):
135+
* {} : compressed data file\n\n
136+
To rebuild this directory, see ../../tools/icu/README.md\n"""
137+
138+
with open(readme_name, 'w') as out_file:
139+
print(msg_fmt.format(icu_ver_major, dst_cmp_datafile), file=out_file)

0 commit comments

Comments
 (0)