X-Git-Url: https://git.deb.at/?a=blobdiff_plain;f=cron.d%2F120synctrans;h=c0813c93f5592939e28ce1eb927ca9c6b943ccb6;hb=98d6d4ed5985e22cfe9824fc1203bc08ecb15c9c;hp=12767abce8ae8a68fb25a6f98dd03f73cb588808;hpb=ee72025828634d9ebfbe2ab4a75849a3409d87da;p=deb%2Fpackages.git diff --git a/cron.d/120synctrans b/cron.d/120synctrans index 12767ab..c0813c9 100755 --- a/cron.d/120synctrans +++ b/cron.d/120synctrans @@ -5,9 +5,13 @@ test -d ${archivedir} || mkdir -p ${archivedir} cd ${archivedir} -if [ -z "${localdir}" ] +if [ -z "${localdir}" ] || [ -n "$ddtp_ftpsite" ] then - echo using remote mirror + if [ -z "$ddtp_ftpsite" ] + then + ddtp_ftpsite="$ftpsite" + fi + echo using remote mirror $ddtp_ftpsite for dist in sid do for part in main @@ -15,9 +19,10 @@ then test -d us/${dist}/${part}/i18n || mkdir -p us/${dist}/${part}/i18n for lang in $ddtplangs do - echo retrieve translated Descs $dist/$part/$lang + locale=$(echo $lang|perl -p -e 's/^([a-z]{2})-([a-z]{2})$/"$1_".uc($2)/e') + echo "retrieve translated Descs $dist/$part/$lang ($locale)" (cd us/${dist}/${part}/i18n && - wget -q -N ${ftpsite}/dists/${dist}/${part}/i18n/Translations-$lang.gz) + $wget_cmd -N ${ddtp_ftpsite}/dists/${dist}/${part}/i18n/Translation-$locale.bz2) done done done @@ -30,10 +35,13 @@ else test -d us/${dist}/${part}/i18n || mkdir -p us/${dist}/${part}/i18n for lang in $ddtplangs do - echo retrieve translated Descs $dist/$part/$lang - rsync -t ${localdir}/dists/${dist}/${part}/i18n/Translation-$lang.gz \ - us/${dist}/${part}/i18n/Translation-$lang.gz + locale=$(echo $lang|perl -p -e 's/^([a-z]{2})-([a-z]{2})$/"$1_".uc($2)/e') + echo "retrieve translated Descs $dist/$part/$lang ($locale)" + rsync -t ${localdir}/dists/${dist}/${part}/i18n/Translation-$locale.bz2 \ + us/${dist}/${part}/i18n/Translation-$locale.bz2 done done done fi + +exit 0