Imported Upstream version 58.1
[platform/upstream/icu.git] / as_is / os400 / unpax-icu.sh
old mode 100644 (file)
new mode 100755 (executable)
index 16e1cba..869e855
@@ -1,4 +1,6 @@
 #!/usr/bin/qsh
+# Copyright (C) 2016 and later: Unicode, Inc. and others.
+# License & terms of use: http://www.unicode.org/copyright.html
 #   Copyright (C) 2000-2011, International Business Machines
 #   Corporation and others.  All Rights Reserved.
 #
@@ -23,6 +25,9 @@ else
 fi
 export QSH
 
+# set this to "v" to list files as they are unpacked (default)
+VERBOSE_UNPACK="v"
+
 # Set the following variable to the list of binary file suffixes (extensions)
 
 
@@ -30,7 +35,7 @@ export QSH
 #binary_suffixes='ico ICO bmp BMP jpg JPG gif GIF brk BRK'
 #ICU specific binary files
 #****************************************************************************
-binary_suffixes='brk BRK bin BIN res RES cnv CNV dat DAT icu ICU spp SPP xml XML nrm NRM'
+binary_suffixes='brk BRK bin BIN res RES cnv CNV dat DAT icu ICU spp SPP xml XML nrm NRM utf16be UTF16BE'
 data_files='icu/source/data/brkitr/* icu/source/data/locales/* icu/source/data/coll/* icu/source/data/rbnf/* icu/source/data/mappings/* icu/source/data/misc/* icu/source/data/translit/* icu/source/data/unidata/* icu/source/test/testdata/*'
 
 #****************************************************************************
@@ -76,13 +81,13 @@ echo "Extracting from $tar_file ..."
 echo ""
 
 # extract everything as iso-8859-1 except these directories
-pax -C 819 -rcvf $tar_file $ebcdic_data
+pax -C 819 -rc${VERBOSE_UNPACK}f $tar_file $ebcdic_data
 
 # extract files while converting them to EBCDIC
 echo ""
 echo "Extracting files which must be in ibm-37 ..."
 echo ""
-pax -C 37 -rvf $tar_file $ebcdic_data
+pax -C 37 -r${VERBOSE_UNPACK}f $tar_file $ebcdic_data
 
 #****************************************************************************
 # For files we have restored as CCSID 37, check the BOM to see if they    
@@ -137,7 +142,9 @@ fi
 
 echo "# Processing special paths."
 # Process special paths
-more_bin_files=$(find icu -type f \( -name '*.zzz' `echo $binary_suffixes | sed -e 's%[a-zA-Z]*%-o -name \*.&%g'` \)  -print)
+more_bin_opts=$(echo $binary_suffixes | sed -e 's%[a-zA-Z0-9]*%-o -name \*.&%g')
+# echo "Looking for additional files: find ... $more_bin_opts"
+more_bin_files=$(find icu -type f \( -name '*.zzz' $more_bin_opts \)  -print)
 echo "Restoring binary files by special paths ($bin_count) ..."
 rm $more_bin_files
 pax -C 819 -rvf $tar_file $more_bin_files