summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenno Schulenberg <bensberg@telfort.nl>2018-10-07 18:20:43 +0200
committerBruno Haible <bruno@clisp.org>2018-10-07 19:16:24 +0200
commit7d73965d906b190c6affcbf64aa76f147727f6c3 (patch)
treea15c0315dc2b72e15da2b0f7c87db44ff3d96843
parent3ea3c45d037aef4d0ab740447c47ad3c69507194 (diff)
downloadgnulib-7d73965d906b190c6affcbf64aa76f147727f6c3.tar.gz
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.
-rwxr-xr-xbuild-aux/bootstrap2
-rwxr-xr-xgnulib-tool2
-rw-r--r--pygnulib/GLImport.py2
3 files changed, 3 insertions, 3 deletions
diff --git a/build-aux/bootstrap b/build-aux/bootstrap
index fa9d7c94af..4a37ed0d08 100755
--- a/build-aux/bootstrap
+++ b/build-aux/bootstrap
@@ -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
diff --git a/gnulib-tool b/gnulib-tool
index 92bfee4fe0..2bae028c86 100755
--- a/gnulib-tool
+++ b/gnulib-tool
@@ -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
diff --git a/pygnulib/GLImport.py b/pygnulib/GLImport.py
index b495d2dfe4..3b4729ee7c 100644
--- a/pygnulib/GLImport.py
+++ b/pygnulib/GLImport.py
@@ -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']