]> Savannah Git Hosting - gnulib.git/commitdiff
bootstrap, gnulib-tool: correct the translations wget command
authorBenno Schulenberg <bensberg@telfort.nl>
Sun, 7 Oct 2018 16:20:43 +0000 (18:20 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 7 Oct 2018 17:16:24 +0000 (19:16 +0200)
Using the -np (--no-parent) option doesn't prevent wget from
traversing the given URL to a default depth of 5, and since
the domain directory contains a href="/latest/" link, this
means that wget searches through all domains anyway and will
also download PO files that are meant for other packages.
When getting the PO files for the nano domain, for example,
you will end up with af.po and ast.po (and many others) too,
but there are no African nor Asturian translations for nano.

So, use the --level option instead, to stop wget from looking
any further than the given URL.

* build-aux/bootstrap (po_download_command_format2): Restrict
recursion to a single level.
* gnulib-tool (func_import): Likewise.
* pygnulib/GLImport.py (GLImport.execute): Likewise.

build-aux/bootstrap
gnulib-tool
pygnulib/GLImport.py

index fa9d7c94afbc690dbb5df73f437e756819d52a8f..4a37ed0d084186a21b431fa0abd72609011ed43f 100755 (executable)
@@ -173,7 +173,7 @@ po_download_command_format=\
 
 # Fallback for downloading .po files (if rsync fails).
 po_download_command_format2=\
-"wget --mirror -nd -q -np -A.po -P '%s' \
+"wget --mirror --level=1 -nd -q -A.po -P '%s' \
  https://translationproject.org/latest/%s/"
 
 # Prefer a non-empty tarname (4th argument of AC_INIT if given), else
index 92bfee4fe085de32e2eff1012fd9254b9637a12a..2bae028c86a2ca902b7413573f601b17601a98d0 100755 (executable)
@@ -5441,7 +5441,7 @@ s,//*$,/,'
               rsync --delete --include "*.po" --exclude "*" -Lrtz "${TP_RSYNC_URI}gnulib/" . && return
             fi
 
-            wget --no-verbose --mirror -nd -np  -A.po -P . "${TP_URL}gnulib/"
+            wget --no-verbose --mirror --level=1 -nd -A.po -P . "${TP_URL}gnulib/"
           }
       )
     else
index b495d2dfe42ce4a5c7b15da495f21fc27c69c8f1..3b4729ee7c8f31135dea3c74bf5203dc45e09fda 100644 (file)
@@ -1210,7 +1210,7 @@ AC_DEFUN([%s_FILE_LIST], [\n''' % macro_prefix
                     args = ['rsync', '--include', '*.po', '--exclude', '*', '-Lrtz', '%sgnulib/' % TP_RSYNC_URI, '.']
                     result = sp.call(args, shell=True)
                 if result != 0:  # use wget
-                    args = ['wget', '--no-verbose', '--mirror', '-nd', '-np', '-A.po', '-P', '.',
+                    args = ['wget', '--no-verbose', '--mirror', '--level=1', '-nd', '-A.po', '-P', '.',
                             '%sgnulib/' % TP_URL]
                     sp.call(args, shell=True)
             else:  # if self.config['dryrun']