mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
704cddfcbc
--HG-- extra : rebase_source : 2561787b6f9ae3dc626cb6bf76e6f78f6cd15664
66 lines
1.6 KiB
Bash
Executable File
66 lines
1.6 KiB
Bash
Executable File
#!/usr/bin/qsh
|
|
# Copyright (C) 2000-2011, International Business Machines
|
|
# Corporation and others. All Rights Reserved.
|
|
#
|
|
# Authors:
|
|
# Ami Fixler
|
|
# Barry Novinger
|
|
# Steven R. Loomis
|
|
# George Rhoten
|
|
# Jason Spieth
|
|
#
|
|
#
|
|
# This script detects if any UTF-8 files were incorrectly converted to EBCDIC, and
|
|
# converts them back.
|
|
|
|
if [ -z "$QSH_VERSION" ];
|
|
then
|
|
QSH=0
|
|
echo "QSH not detected (QSH_VERSION not set) - just testing."
|
|
else
|
|
QSH=1
|
|
#echo "QSH version $QSH_VERSION"
|
|
fi
|
|
export QSH
|
|
|
|
tar_file=$1
|
|
echo ""
|
|
echo "Determining binary files by BOM ..."
|
|
echo ""
|
|
bin_count=0
|
|
binary_files=""
|
|
# Process BOMs
|
|
for file in `find ./icu/source/data/unidata \( -name \*.txt -print \)`; do
|
|
bom8=`od -t x1 -N 3 $file|\
|
|
head -n 1|\
|
|
cut -c10-18`;
|
|
#Find a converted UTF-8 BOM
|
|
echo "file $file bom /${bom8}/"
|
|
if [ "$bom8" = "57 8b ab" ]
|
|
then
|
|
file="`echo $file | cut -d / -f2-`"
|
|
echo "converting ${file}"
|
|
if [ `echo $binary_files | wc -w` -lt 200 ]
|
|
then
|
|
bin_count=`expr $bin_count + 1`
|
|
binary_files="$binary_files $file";
|
|
else
|
|
echo "Restoring binary files by BOM ($bin_count)..."
|
|
rm $binary_files;
|
|
pax -C 819 -rvf $tar_file $binary_files;
|
|
echo "Determining binary files by BOM ($bin_count)..."
|
|
binary_files="$file";
|
|
bin_count=`expr $bin_count + 1`
|
|
fi
|
|
fi
|
|
done
|
|
if [ `echo $binary_files | wc -w` -gt 0 ]
|
|
then
|
|
echo restoring
|
|
rm $binary_files
|
|
pax -C 819 -rvf $tar_file $binary_files
|
|
fi
|
|
|
|
|
|
|