ICU-999 Find the binary and UTF-8 files differently for pax, since the binary tag went away.

X-SVN-Rev: 5448
This commit is contained in:
George Rhoten 2001-08-10 16:36:50 +00:00
parent 3ba6b49b18
commit b3c2c3cbbb
2 changed files with 51 additions and 13 deletions

View file

@ -11,7 +11,9 @@
#
# Set the following variable to the list of binary file suffixes (extensions)
binary_suffixes='ico ICO bmp BMP jpg JPG gif GIF'
#binary_suffixes='ico ICO bmp BMP jpg JPG gif GIF brk BRK'
#ICU specific binary files
binary_suffixes='brk BRK bin BIN'
usage()
{
@ -30,10 +32,10 @@ if [ ! -r $1 ]; then
fi
# set up a few variables
# extract files while converting them to EBCDIC
echo ""
echo "Extracting from $1 ..."
echo ""
# extract files while converting them to EBCDIC
pax -rvf $1 -o to=IBM-1047,from=ISO8859-1
if [ $# -gt 1 ]; then
@ -63,11 +65,25 @@ echo ""
echo "Determining binary files ..."
echo ""
for dir in `find ./icu -type d \( -name CVS -o -print \)`; do
if [ -f $dir/CVS/Entries ]; then
binary_files="$binary_files`cat $dir/CVS/Entries | fgrep -- -kb \
| cut -d / -f2 | sed -e "s%^%$dir/%" \
| sed -e "s%^\./%%" | tr '\n' ' '`"
#for dir in `find ./icu -type d \( -name CVS -o -print \)`; do
# if [ -f $dir/CVS/Entries ]; then
# binary_files="$binary_files`cat $dir/CVS/Entries | fgrep -- -kb \
# | cut -d / -f2 | sed -e "s%^%$dir/%" \
# | sed -e "s%^\./%%" | tr '\n' ' '`"
# fi
#done
#echo "Detecting Unicode files"
for file in `find icu \( -name \*.txt -print \)`; do
bom8=`head -c 3 $file|\
od -t x1|\
head -n 1|\
sed 's/ */ /g'|\
cut -f2-4 -d ' '|\
tr 'A-Z' 'a-z'`;
#Find a converted UTF-8 BOM
if test "$bom8" = "57 8b ab"
then
binary_files="$binary_files $file";
fi
done

View file

@ -11,7 +11,9 @@
#
# Set the following variable to the list of binary file suffixes (extensions)
binary_suffixes='ico ICO bmp BMP jpg JPG gif GIF'
#binary_suffixes='ico ICO bmp BMP jpg JPG gif GIF brk BRK'
#ICU specific binary files
binary_suffixes='brk BRK bin BIN'
usage()
{
@ -33,6 +35,7 @@ fi
echo ""
echo "Extracting from $1 ..."
echo ""
# extract everything as iso-8859-1 except these directories
pax -C 819 -rcvf $1 icu/data/* icu/source/test/testdata/*
# extract files while converting them to EBCDIC
@ -68,14 +71,32 @@ echo ""
echo "Determining binary files ..."
echo ""
for dir in `find ./icu -type d \( -name CVS -o -print \)`; do
if [ -f $dir/CVS/Entries ]; then
binary_files="$binary_files`cat $dir/CVS/Entries | fgrep -- -kb \
| cut -d / -f2 | sed -e "s%^%$dir/%" \
| sed -e "s%^\./%%" | tr '\n' ' '`"
#for dir in `find ./icu -type d \( -name CVS -o -print \)`; do
# if [ -f $dir/CVS/Entries ]; then
# binary_files="$binary_files`cat $dir/CVS/Entries | fgrep -- -kb \
# | cut -d / -f2 | sed -e "s%^%$dir/%" \
# | sed -e "s%^\./%%" | tr '\n' ' '`"
# fi
#done
#echo "Detecting Unicode files"
for file in `find ./icu \( -name \*.txt -print \)`; do
bom8=`head -n 1 $file|\
od -t x1|\
head -n 1|\
sed 's/ */ /g'|\
cut -f2-4 -d ' '|\
tr 'A-Z' 'a-z'`;
# echo "bom8 is" $bom8 "for" $file
# bom8=`head -c 3 $file|od -t x1|head -n 1|cut -d ' ' -f2-4`;
#Find a converted UTF-8 BOM
if [ "$bom8" = "057 08b 0ab" ]
then
binary_files="$binary_files `echo $file | cut -d / -f2-`";
fi
done
#echo $binary_files
for i in $(pax -f $1 2>/dev/null)
do
case $i in
@ -107,6 +128,7 @@ if [ ${#binary_files} -eq 0 ]; then
else
echo "Restoring binary files ..."
echo ""
rm $binary_files
pax -C 819 -rvf $1 $binary_files
fi
echo ""