From 8847167d8e883fe54ecc4dc058f4fe43a1db45d5 Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Tue, 20 Sep 2016 15:25:03 -0700 Subject: [PATCH] deps: fix icu-shrinker to handle ICU 58 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ICU’s license file changed from `license.html` to `LICENSE`. Fix `shrink-icu-src.py` (which is manually run) to accept either file. Related to https://github.com/nodejs/node/issues/7844 which is the 58 bump. --- tools/icu/shrink-icu-src.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/tools/icu/shrink-icu-src.py b/tools/icu/shrink-icu-src.py index d0c82d87468dc0..10b4fdf52c1444 100644 --- a/tools/icu/shrink-icu-src.py +++ b/tools/icu/shrink-icu-src.py @@ -48,16 +48,18 @@ def icu_ignore(dir, files): ign = ign + files # except... ign.remove('source') - ign.remove('license.html') - ign.remove('LICENSE') + if 'license.html' in ign: + ign.remove('license.html') + if 'LICENSE' in ign: + ign.remove('LICENSE') elif subdir == 'source': - ign = ign + ['layout','samples','test','extra','config','layoutex','allinone'] + ign = ign + ['layout','samples','test','extra','config','layoutex','allinone','data'] ign = ign + ['runConfigureICU','install-sh','mkinstalldirs','configure'] elif subdir == 'source/tools': ign = ign + ['tzcode','ctestfw','gensprep','gennorm2','gendict','icuswap', 'genbrk','gencfu','gencolusb','genren','memcheck','makeconv','gencnval','icuinfo','gentest'] - elif subdir == 'source/data': - ign = ign + ['unidata','curr','zone','unit','lang','region','misc','sprep'] + #elif subdir == 'source/data': + # ign = ign + ['unidata','curr','zone','unit','lang','region','misc','sprep'] # else: # print '!%s! [%s]' % (subdir, files) ign = ign + ['.DS_Store', 'Makefile', 'Makefile.in'] @@ -103,6 +105,10 @@ def icu_info(icu_full_path): shutil.copytree(options.icusrc, options.icusmall, ignore=icu_ignore) print '%s --> %s' % (src_datafile, dst_datafile) +# now, make the data dir (since we ignored it) +os.mkdir(os.path.join(os.path.join(options.icusmall, "source", "data"))) +os.mkdir(os.path.join(os.path.join(options.icusmall, "source", "data", "in"))) + # OK, now copy the data file shutil.copy(src_datafile, dst_datafile)