+# URL of our text domain page in Translation Project
+TP_URL="http://www.iro.umontreal.ca/translation/maint/tar/"
+
+# Ensure file names are sorted consistently across platforms;
+# e.g., m4/ulonglong_gl.m4 should follow m4/ulonglong.m4.
+LC_ALL=C
+export LC_ALL
+
+usage() {
+ cat <<EOF
+ usage: $0 [--gnulib-srcdir=DIR][--paxutils-srcdir=DIR][--cvs-auth=AUTH-METHOD][--cvs-user=USERNAME][--no-po]
+ Options are:
+ --paxutils-srcdir=DIRNAME Specify the local directory where paxutils
+ sources reside. Use this if you already
+ have paxutils sources on your machine, and
+ do not want to waste your bandwidth dowloading
+ them again.
+ --gnulib-srcdir=DIRNAME Specify the local directory where gnulib
+ sources reside. Use this if you already
+ have gnulib sources on your machine, and
+ do not want to waste your bandwidth dowloading
+ them again.
+ --cvs-auth=METHOD Set the CVS access method used for downloading
+ gnulib files. METHOD is one of the keywords
+ accepted by cvs -d option (see info cvs
+ repository).
+ --cvs-user=USERNAME Set the CVS username to be used when accessing
+ the gnulib repository.
+ --no-po Do not download po files.
+ --update-po[=LANG] Update po file(s) and exit.
+
+Running without arguments will suffice in most cases. It is equivalent
+to
+
+ ./bootstrap --cvs-auth=ext --cvs-user=anoncvs
+
+EOF
+}
+
+update_po() {
+ if [ $# = 1 ]; then
+ case $1 in
+ *.po) POFILE=$1;;
+ *) POFILE=${1}.po;;
+ esac
+ echo "$0: getting translation for $1..."
+ wget -r -C off $TP_URL/$POFILE
+ else
+ echo "$0: getting translations into po..."
+ (cd po &&
+ rm -f dummy `ls | sed -n '/\.gmo$/p; /\.po/p'` &&
+ wget -nv -nd -r -l 1 -A .po -C off $TP_URL &&
+ rm -f index.html index.html.[0-9]*
+ ls *.po | sed 's/\.po$//' >LINGUAS
+ ) || exit
+ fi
+}