20111126 update
tux@slitaz:~$ echo ${LANG/_/-} ${LANG%_*} ${LANG%.*} | sed s/_/-/
zh-TW.UTF-8 zh zh-TW
tux@slitaz:~$ diff get-LibreOffice-orig get-LibreOffice
--- get-LibreOffice-orig
+++ get-LibreOffice
@@ -24,7 +24,7 @@
TARBALL="LibO_${VER}_${SUFFIX}"
-for LOC in ${LANG/_/-} ${LANG%_*}; do
+for LOC in ${LANG/_/-} ${LANG%_*} ${LANG%.*} | sed s/_/-/; do
L_SUFFIX="Linux_x86_langpack-rpm_$LOC.tar.gz"
L_TARBALL="LibO_${VER}_${L_SUFFIX}"
LANG_URL="$WGET_URL/${VERSION}/rpm/x86/${L_TARBALL}"
tux@slitaz:~$
----
get-LibreOffice
tar: can't open '/tmp/src.1650/LibO_3.4.3_Linux_x86_langpack-rpm_zh.tar.gz': No such file or directory
http://download.documentfoundation.org/libreoffice/stable/3.4.3/rpm/x86/LibO_3.4.3_Linux_x86_langpack-rpm_zh-TW.tar.gz
1.
tux@slitaz:~$ head -1 /tmp/get-LibreOffice.log
tar: can't open '/tmp/src.1650/LibO_3.4.3_Linux_x86_langpack-rpm_zh.tar.gz': No such file or directory
tux@slitaz:~$ tazpkg info get-LibreOffice
Tazpkg information
================================================================================
Package : get-LibreOffice
Version : 1.2
Category : office
Short desc : Productivity suite.
Maintainer : ben@seawolfsanctuary.com
Web site : http://www.documentfoundation.org
================================================================================
tux@slitaz:~$ tazpkg info LibreOffice
Tazpkg information
================================================================================
Package : LibreOffice
Version : 3.4.3
Category : office
Short desc : Productivity suite.
Maintainer :
Depends : java6-jre
Web site : http://www.libreoffice.org
================================================================================
2.
http://download.documentfoundation.org/libreoffice/stable/3.4.3/rpm/x86/
[..]
LibO_3.4.3_Linux_x86_langpack-rpm_xh.tar.gz | 25-Aug-2011 13:57 | 7.8M | Details | |
LibO_3.4.3_Linux_x86_langpack-rpm_xh.tar.gz.asc | 25-Aug-2011 13:57 | 836 | Details | |
LibO_3.4.3_Linux_x86_langpack-rpm_zh-CN.tar.gz | 25-Aug-2011 13:57 | 1.7M | Details | |
LibO_3.4.3_Linux_x86_langpack-rpm_zh-CN.tar.gz.asc | 25-Aug-2011 13:57 | 836 | Details | |
LibO_3.4.3_Linux_x86_langpack-rpm_zh-TW.tar.gz | 25-Aug-2011 13:57 | 1.7M | Details | |
LibO_3.4.3_Linux_x86_langpack-rpm_zh-TW.tar.gz.asc | 25-Aug-2011 13:57 | 836 | Details | |
LibO_3.4.3_Linux_x86_langpack-rpm_zu.tar.gz | 25-Aug-2011 13:57 | 1.6M | Details | |
LibO_3.4.3_Linux_x86_langpack-rpm_zu.tar.gz.asc | 25-Aug-2011 13:57 | 836 | Details |
3.
tux@slitaz:~$ grep LOC /usr/bin/get-LibreOffice
for LOC in ${LANG/_/-} ${LANG%_*}; do
L_SUFFIX="Linux_x86_langpack-rpm_$LOC.tar.gz"
echo "Added $LANG ($LOC)."
tux@slitaz:~$ echo ${LANG/_/-}
zh-TW.UTF-8
tux@slitaz:~$ echo ${LANG%_*}
zh
tux@slitaz:~$ echo ${LANG/_/-} ${LANG%_*}
zh-TW.UTF-8 zh