]> Savannah Git Hosting - gnulib.git/commitdiff
gnulib-tool.py: follow gnulib-tool changes, part 9
authorBruno Haible <bruno@clisp.org>
Fri, 8 Sep 2017 23:26:20 +0000 (01:26 +0200)
committerBruno Haible <bruno@clisp.org>
Sat, 9 Sep 2017 14:29:00 +0000 (16:29 +0200)
Follow gnulib-tool change
2014-09-05  Mathieu Anquetin  <mathieu@anquetin.eu>
Fallback to wget when rsync of PO files fails.

pygnulib/GLImport.py

index d5f5ea6f46d1b9a97b8fbe4109c587cb5a06af77..125ee9d2b7dd4ed1f1396d408437eeede894ad36 100644 (file)
@@ -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)