A little hack for the script that pulls catkeys from the HTA site. It corrects the confusion of 'zh-hans' vs.'zh_hans' until the catkeys at HTA are correctly found under 'zh_hans'.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43192 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Joachim Seemer 2011-11-05 10:35:46 +00:00
parent c0ea2063b7
commit a94afff898
1 changed files with 15 additions and 9 deletions

View File

@ -115,31 +115,37 @@ DownloadAllLanguageTarballs()
DownloadLanguageTarball()
{
cd "$tempDirectory"
echo "Downloading language: $1"
LANGUAGE=$1
# The package for zh_hans catalogs is actually called zh-hans
if [ "$LANGUAGE" = "zh_hans" ] ; then
LANGUAGE="zh-hans"
fi
if [ -e "$1.tgz" ] ; then
rm "$1.tgz"
cd "$tempDirectory"
echo "Downloading language: $LANGUAGE"
if [ -e "$LANGUAGE.tgz" ] ; then
rm "$LANGUAGE.tgz"
fi
attempt=0
local tarballURL="http://hta.polytect.org/catalogs/tarball"
while [ $(wget -nv -U hta_committer -O "$1.tgz" "$tarballURL/$1" ; echo $?) -ne 0 ]; do
while [ $(wget -nv -U hta_committer -O "$LANGUAGE.tgz" "$tarballURL/$LANGUAGE" ; echo $?) -ne 0 ]; do
if [ $attempt -eq 5 ]; then
break
fi
(( attempt++ ))
echo "Download attempt #$attempt failed. Retrying ..."
if [ -e "$1" ]; then
rm "$1"
if [ -e "$LANGUAGE" ]; then
rm "$LANGUAGE"
fi
done
if [ $attempt -ge 5 ]; then
if [ -e "$1" ]; then
rm "$1"
if [ -e "$LANGUAGE" ]; then
rm "$LANGUAGE"
fi
echo "WARNING: Max download retries exceeded for language $1."
echo "WARNING: Max download retries exceeded for language $LANGUAGE."
fi
cd "$subversionRootDirectory"