changeset 39895:e04cf5381eec

bootstrap, gnulib-tool: correct the translations wget command 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.
author Benno Schulenberg <bensberg@telfort.nl>
date Sun, 07 Oct 2018 18:20:43 +0200
parents 8c0769373a90
children b658dddc67fd
files build-aux/bootstrap gnulib-tool pygnulib/GLImport.py
diffstat 3 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/build-aux/bootstrap	Sun Oct 07 09:33:21 2018 +0200
+++ b/build-aux/bootstrap	Sun Oct 07 18:20:43 2018 +0200
@@ -173,7 +173,7 @@
 
 # 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
--- a/gnulib-tool	Sun Oct 07 09:33:21 2018 +0200
+++ b/gnulib-tool	Sun Oct 07 18:20:43 2018 +0200
@@ -5441,7 +5441,7 @@
               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
--- a/pygnulib/GLImport.py	Sun Oct 07 09:33:21 2018 +0200
+++ b/pygnulib/GLImport.py	Sun Oct 07 18:20:43 2018 +0200
@@ -1210,7 +1210,7 @@
                     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']