bootstrap: uses rsync to download the .po files
authorJim Meyering <jim@meyering.net>
Sun, 2 Sep 2007 07:38:39 +0000 (09:38 +0200)
committerJim Meyering <jim@meyering.net>
Sun, 2 Sep 2007 07:38:50 +0000 (09:38 +0200)
* bootstrap (po_download_command_format): New global.
(download_po_files): Use rsync.
(update_po_files): Don't remove .po files after download,
so future rsync runs can take advantage of the copies.

ChangeLog
bootstrap

index 1fa773e..2ee14dc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2007-09-02  Jim Meyering  <jim@meyering.net>
+
+       bootstrap: uses rsync to download the .po files
+       * bootstrap (po_download_command_format): New global.
+       (download_po_files): Use rsync.
+       (update_po_files): Don't remove .po files after download,
+       so future rsync runs can take advantage of the copies.
+
 2007-09-01  Jim Meyering  <jim@meyering.net>
 
        * bootstrap (gnulib_tool): Make sha1sum check quietly.
index 42f0fad..39c6971 100755 (executable)
--- a/bootstrap
+++ b/bootstrap
@@ -70,9 +70,13 @@ gnulib_modules=
 # Any gnulib files needed that are not in modules.
 gnulib_files=
 
-# Translation Project URL, for the registry of all projects
-# and for the translation-team master directory.
-TP_URL="http://translationproject.org/latest/"
+# The command to download all .po files for a specified domain into
+# a specified directory.  Fill in the first %s is the domain name, and
+# the second with the destination directory.  Use rsync's -L and -r
+# options because the latest/%s directory and the .po files within are
+# all symlinks.
+po_download_command_format=\
+"rsync -Lrtvz 'translationproject.org::tp/latest/%s/' '%s'"
 
 extract_package_name='
   /^AC_INIT(/{
@@ -255,17 +259,9 @@ gnulib_tool=$GNULIB_SRCDIR/gnulib-tool
 download_po_files() {
   subdir=$1
   domain=$2
-
-  case $WGET_COMMAND in
-  '')
-    echo "$0: wget not available; skipping translations";;
-  ?*)
-    echo "$0: getting translations into $subdir for $domain..." &&
-
-    (cd $subdir && rm -f dummy `ls | sed -n '/\.po/p'` &&
-     $WGET_COMMAND -r -l1 -nd -np -A.po $TP_URL/$domain)
-    ;;
-  esac
+  echo "$0: getting translations into $subdir for $domain..."
+  cmd=`printf "$po_download_command_format" "$domain" "$subdir"`
+  eval "$cmd"
 }
 
 # Download .po files to $po_dir/.reference and copy only the new
@@ -292,7 +288,6 @@ update_po_files() {
        echo "updated $po_dir/$po.po..."
        cp "$new_po" "$po_dir/$po.po" && sha1sum < "$new_po" > "$cksum_file"
      fi
-     rm -f "$new_po"
   done
 }