>From d343de60a9d6d30226a2a1e2a8ad271b7df77aae Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 9 Sep 2017 01:26:20 +0200 Subject: [PATCH 13/16] gnulib-tool.py: follow gnulib-tool changes, part 9 Follow gnulib-tool change from 2014-09-05 "Fallback to wget when rsync of PO files fails." --- pygnulib/GLImport.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/pygnulib/GLImport.py b/pygnulib/GLImport.py index d5f5ea6..125ee9d 100644 --- a/pygnulib/GLImport.py +++ b/pygnulib/GLImport.py @@ -1204,16 +1204,15 @@ AC_DEFUN([%s_FILE_LIST], [\n''' % macro_prefix if not self.config['dryrun']: print('Fetching gnulib PO files from %s' % TP_URL) os.chdir(joinpath(destdir, pobase)) - cmd = 'if type rsync 2>/dev/null | grep / > /dev/null; ' - cmd += 'then echo 1; else echo 0; fi' - result = sp.check_output(cmd, shell=True) - result = bool(int(result)) - if result: # use rsync + cmd = 'type rsync 2>/dev/null | grep / > /dev/null' + result = sp.call(cmd, shell=True) + if result == 0: # use rsync args = ['rsync', '-Lrtz', '%sgnulib/' % TP_RSYNC_URI, '.'] - else: # use wget + result = sp.call(args, shell=True) + if result != 0: # use wget args = ['wget', '--no-verbose', '-r', '-l1', '-nd', '-np', '-A.po', '%sgnulib/' % TP_URL] - sp.call(args, shell=True) + sp.call(args, shell=True) else: # if self.config['dryrun'] print('Fetch gnulib PO files from %s' % TP_URL) -- 2.7.4