Hi Dmitry,

I've started to copy all modifications done to gnulib-tool since 2012
over to gnulib-tool.py. Here is the first round of such updates.
OK to push?

Most of these are not really tested, and I'm a beginner regarding Python.
Therefore it's very possible that you find mistakes in these patches.

Bruno
>From e40de420ae64e970376bcfe25105e3ba1f0efbbc Mon Sep 17 00:00:00 2001
From: Bruno Haible <[email protected]>
Date: Fri, 8 Sep 2017 23:59:29 +0200
Subject: [PATCH 05/16] gnulib-tool.py: follow gnulib-tool changes, part 1

* pygnulib/GLInfo.py: Follow gnulib-tool change from 2012-06-21
"gnulib-tool: --create-[mega]testdir, --[mega]test implies --with-tests."
---
 pygnulib/GLInfo.py | 27 +++++++++++++++------------
 1 file changed, 15 insertions(+), 12 deletions(-)

diff --git a/pygnulib/GLInfo.py b/pygnulib/GLInfo.py
index 71f19ca..c0bae0e 100644
--- a/pygnulib/GLInfo.py
+++ b/pygnulib/GLInfo.py
@@ -154,15 +154,11 @@ Operation modes:
       --update              update the current package, restore files omitted
                             from version control
       --create-testdir      create a scratch package with the given modules
-                            (pass --with-tests to include the unit tests)
       --create-megatestdir  create a mega scratch package with the given modules
                             one by one and all together
-                            (pass --with-tests to include the unit tests)
       --test                test the combination of the given modules
-                            (pass --with-tests to include the unit tests)
                             (recommended to use CC=\"gcc -Wall\" here)
       --megatest            test the given modules one by one and all together
-                            (pass --with-tests to include the unit tests)
                             (recommended to use CC=\"gcc -Wall\" here)
       --extract-description        extract the description
       --extract-comment            extract the comment
@@ -200,21 +196,35 @@ Options for --import, --add/remove-import, --update:
 
       --dry-run             Only print what would have been done.
 
+Options for --import, --add/remove-import:
+
+      --with-tests          Include unit tests for the included modules.
+
+Options for --create-[mega]testdir, --[mega]test:
+
+      --without-tests       Don't include unit tests for the included modules.
+
 Options for --import, --add/remove-import,
             --create-[mega]testdir, --[mega]test:
 
-      --with-tests          Include unit tests for the included modules.
       --with-obsolete       Include obsolete modules when they occur among the
                             dependencies. By default, dependencies to obsolete
                             modules are ignored.
       --with-c++-tests      Include even unit tests for C++ interoperability.
+      --without-c++-tests   Exclude unit tests for C++ interoperability.
       --with-longrunning-tests
                             Include even unit tests that are long-runners.
+      --without-longrunning-tests
+                            Exclude unit tests that are long-runners.
       --with-privileged-tests
                             Include even unit tests that require root
                             privileges.
+      --without-privileged-tests
+                            Exclude unit tests that require root privileges.
       --with-unportable-tests
                             Include even unit tests that fail on some platforms.
+      --without-unportable-tests
+                            Exclude unit tests that fail on some platforms.
       --with-all-tests      Include all kinds of problematic unit tests.
       --avoid=MODULE        Avoid including the given MODULE. Useful if you
                             have code that provides equivalent functionality.
@@ -264,13 +274,6 @@ Options for --import, --add/remove-import:
 
 Options for --create-[mega]testdir, --[mega]test:
 
-      --without-c++-tests   Exclude unit tests for C++ interoperability.
-      --without-longrunning-tests
-                            Exclude unit tests that are long-runners.
-      --without-privileged-tests
-                            Exclude unit tests that require root privileges.
-      --without-unportable-tests
-                            Exclude unit tests that fail on some platforms.
       --single-configure    Generate a single configure file, not a separate
                             configure file for the tests directory.
 
-- 
2.7.4

>From 1342b9b4d8b8d0ba3174bae289e701a03443fe24 Mon Sep 17 00:00:00 2001
From: Bruno Haible <[email protected]>
Date: Sat, 9 Sep 2017 00:03:44 +0200
Subject: [PATCH 06/16] gnulib-tool.py: follow gnulib-tool changes, part 2

* pygnulib/GLImport.py: Follow gnulib-tool change from 2012-08-13
"gnulib-tool: Fix persistence of --witness-c-macro option."
---
 pygnulib/GLImport.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pygnulib/GLImport.py b/pygnulib/GLImport.py
index 2236e8f..c7b5142 100644
--- a/pygnulib/GLImport.py
+++ b/pygnulib/GLImport.py
@@ -531,7 +531,7 @@ gnulib-tool.m4 macro invocations:\n''' % actioncmd
             emit += 'gl_LIBTOOL\n'
         emit += 'gl_MACRO_PREFIX([%s])\n' % macro_prefix
         emit += 'gl_PO_DOMAIN([%s])\n' % podomain
-        emit += 'gl_WITNESS_C_DOMAIN([%s])\n' % witness_c_macro
+        emit += 'gl_WITNESS_C_MACRO([%s])\n' % witness_c_macro
         if vc_files:
             emit += 'gl_VC_FILES([%s])\n' % vc_files
         if type(emit) is bytes:
-- 
2.7.4

>From 75a97abf4590be750b1924d4a7e70cb744dab069 Mon Sep 17 00:00:00 2001
From: Bruno Haible <[email protected]>
Date: Sat, 9 Sep 2017 00:32:50 +0200
Subject: [PATCH 07/16] gnulib-tool.py: follow gnulib-tool changes, part 3

Follow gnulib-tool change from 2012-08-26
"gnulib-tool: Remove no-op option --no-changelog."
* gnulib-tool.py: Remove parsing of --no-changelog option.
* pygnulib/constants.py: Remove FILES dictionary.
* pygnulib/*: Update.
---
 gnulib-tool.py              | 6 ------
 pygnulib/GLConfig.py        | 1 -
 pygnulib/GLEmiter.py        | 1 -
 pygnulib/GLError.py         | 1 -
 pygnulib/GLFileSystem.py    | 1 -
 pygnulib/GLImport.py        | 1 -
 pygnulib/GLInfo.py          | 2 --
 pygnulib/GLMakefileTable.py | 1 -
 pygnulib/GLModuleSystem.py  | 1 -
 pygnulib/GLTestDir.py       | 1 -
 pygnulib/constants.py       | 6 +-----
 11 files changed, 1 insertion(+), 21 deletions(-)

diff --git a/gnulib-tool.py b/gnulib-tool.py
index 806f4d7..24bfd92 100755
--- a/gnulib-tool.py
+++ b/gnulib-tool.py
@@ -44,7 +44,6 @@ APP = constants.APP
 DIRS = constants.DIRS
 ENCS = constants.ENCS
 UTILS = constants.UTILS
-FILES = constants.FILES
 MODES = constants.MODES
 TESTS = constants.TESTS
 compiler = constants.compiler
@@ -213,11 +212,6 @@ def main():
                         dest='mode_xmaintainer',
                         default=None,
                         nargs='*')
-    # no-changelog
-    parser.add_argument('--no-changelog',
-                        dest='changelog',
-                        default=None,
-                        action='store_false')
     # destdir
     parser.add_argument('-d', '--dir',
                         dest='destdir',
diff --git a/pygnulib/GLConfig.py b/pygnulib/GLConfig.py
index 4d96fcb..1e1a090 100644
--- a/pygnulib/GLConfig.py
+++ b/pygnulib/GLConfig.py
@@ -32,7 +32,6 @@ APP = constants.APP
 DIRS = constants.DIRS
 ENCS = constants.ENCS
 UTILS = constants.UTILS
-FILES = constants.FILES
 MODES = constants.MODES
 TESTS = constants.TESTS
 compiler = constants.compiler
diff --git a/pygnulib/GLEmiter.py b/pygnulib/GLEmiter.py
index 6df6eca..b6f8991 100644
--- a/pygnulib/GLEmiter.py
+++ b/pygnulib/GLEmiter.py
@@ -38,7 +38,6 @@ APP = constants.APP
 DIRS = constants.DIRS
 ENCS = constants.ENCS
 UTILS = constants.UTILS
-FILES = constants.FILES
 MODES = constants.MODES
 TESTS = constants.TESTS
 compiler = constants.compiler
diff --git a/pygnulib/GLError.py b/pygnulib/GLError.py
index 04e2e73..9c249a3 100644
--- a/pygnulib/GLError.py
+++ b/pygnulib/GLError.py
@@ -29,7 +29,6 @@ APP = constants.APP
 DIRS = constants.DIRS
 ENCS = constants.ENCS
 UTILS = constants.UTILS
-FILES = constants.FILES
 MODES = constants.MODES
 TESTS = constants.TESTS
 compiler = constants.compiler
diff --git a/pygnulib/GLFileSystem.py b/pygnulib/GLFileSystem.py
index 9821fd6..7db09e1 100644
--- a/pygnulib/GLFileSystem.py
+++ b/pygnulib/GLFileSystem.py
@@ -33,7 +33,6 @@ APP = constants.APP
 DIRS = constants.DIRS
 ENCS = constants.ENCS
 UTILS = constants.UTILS
-FILES = constants.FILES
 MODES = constants.MODES
 TESTS = constants.TESTS
 compiler = constants.compiler
diff --git a/pygnulib/GLImport.py b/pygnulib/GLImport.py
index c7b5142..7522eae 100644
--- a/pygnulib/GLImport.py
+++ b/pygnulib/GLImport.py
@@ -41,7 +41,6 @@ APP = constants.APP
 DIRS = constants.DIRS
 ENCS = constants.ENCS
 UTILS = constants.UTILS
-FILES = constants.FILES
 MODES = constants.MODES
 TESTS = constants.TESTS
 compiler = constants.compiler
diff --git a/pygnulib/GLInfo.py b/pygnulib/GLInfo.py
index c0bae0e..baec6af 100644
--- a/pygnulib/GLInfo.py
+++ b/pygnulib/GLInfo.py
@@ -30,7 +30,6 @@ APP = constants.APP
 DIRS = constants.DIRS
 ENCS = constants.ENCS
 UTILS = constants.UTILS
-FILES = constants.FILES
 MODES = constants.MODES
 TESTS = constants.TESTS
 compiler = constants.compiler
@@ -270,7 +269,6 @@ Options for --import, --add/remove-import:
       --vc-files            Update version control related files.
       --no-vc-files         Don't update version control related files
                             (.gitignore and/or .cvsignore).
-      --no-changelog        Don't update or create ChangeLog files.
 
 Options for --create-[mega]testdir, --[mega]test:
 
diff --git a/pygnulib/GLMakefileTable.py b/pygnulib/GLMakefileTable.py
index 2ecc268..74e6fe7 100644
--- a/pygnulib/GLMakefileTable.py
+++ b/pygnulib/GLMakefileTable.py
@@ -33,7 +33,6 @@ APP = constants.APP
 DIRS = constants.DIRS
 ENCS = constants.ENCS
 UTILS = constants.UTILS
-FILES = constants.FILES
 MODES = constants.MODES
 TESTS = constants.TESTS
 compiler = constants.compiler
diff --git a/pygnulib/GLModuleSystem.py b/pygnulib/GLModuleSystem.py
index 09ce5f6..2a2c8cd 100644
--- a/pygnulib/GLModuleSystem.py
+++ b/pygnulib/GLModuleSystem.py
@@ -33,7 +33,6 @@ APP = constants.APP
 DIRS = constants.DIRS
 ENCS = constants.ENCS
 UTILS = constants.UTILS
-FILES = constants.FILES
 MODES = constants.MODES
 TESTS = constants.TESTS
 compiler = constants.compiler
diff --git a/pygnulib/GLTestDir.py b/pygnulib/GLTestDir.py
index 562e170..2937b5d 100644
--- a/pygnulib/GLTestDir.py
+++ b/pygnulib/GLTestDir.py
@@ -41,7 +41,6 @@ APP = constants.APP
 DIRS = constants.DIRS
 ENCS = constants.ENCS
 UTILS = constants.UTILS
-FILES = constants.FILES
 MODES = constants.MODES
 TESTS = constants.TESTS
 compiler = constants.compiler
diff --git a/pygnulib/constants.py b/pygnulib/constants.py
index ec2ca62..6cb1ec9 100644
--- a/pygnulib/constants.py
+++ b/pygnulib/constants.py
@@ -59,7 +59,6 @@ APP = dict()  # Application
 DIRS = dict()  # Directories
 UTILS = dict()  # Utilities
 ENCS = dict()  # Encodings
-FILES = dict()  # Files
 MODES = dict()  # Modes
 TESTS = dict()  # Tests
 NL = '''
@@ -105,9 +104,6 @@ DIRS['tests'] = os.path.join(DIRS['root'], 'tests')
 DIRS['git'] = os.path.join(DIRS['root'], '.git')
 DIRS['cvs'] = os.path.join(DIRS['root'], 'CVS')
 
-# Set FILES dictionary
-FILES['changelog'] = os.path.join(DIRS['root'], 'ChangeLog')
-
 # Set MODES dictionary
 MODES = \
     {
@@ -449,4 +445,4 @@ def nlcount(text):
     print(before, after)
 
 
-__all__ += ['APP', 'DIRS', 'FILES', 'MODES', 'UTILS']
+__all__ += ['APP', 'DIRS', 'MODES', 'UTILS']
-- 
2.7.4

>From b09e9b0ab24a2c6b7d96c171a1a25e9d9777ad22 Mon Sep 17 00:00:00 2001
From: Bruno Haible <[email protected]>
Date: Sat, 9 Sep 2017 00:49:56 +0200
Subject: [PATCH 08/16] gnulib-tool.py: follow gnulib-tool changes, part 4

Follow gnulib-tool change from 2013-01-05
"gnulib-tool: fix incompatibility with autopoint 0.18.2"
* pygnulib/GLEmiter.py: Don't indent AM_GNU_GETTEXT_VERSION line.
---
 pygnulib/GLEmiter.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/pygnulib/GLEmiter.py b/pygnulib/GLEmiter.py
index b6f8991..178cdee 100644
--- a/pygnulib/GLEmiter.py
+++ b/pygnulib/GLEmiter.py
@@ -180,6 +180,10 @@ class GLEmiter(object):
             if disable_gettext:
                 snippet = snippet.replace('AM_GNU_GETTEXT([external])', 'dnl you must \
 add AM_GNU_GETTEXT([external]) or similar to configure.ac.')
+            else:
+                # Don't indent AM_GNU_GETTEXT_VERSION line, as that confuses
+                # autopoint through at least GNU gettext version 0.18.2.
+                snippet = compiler('^ *AM_GNU_GETTEXT_VERSION').sub('AM_GNU_GETTEXT_VERSION', snippet)
             emit += snippet
             if str(module) == 'alloca' and libtool and not disable_libtool:
                 emit += 'changequote(,)dnl\n'
-- 
2.7.4

>From 68bcf297595c6517e5da623addae261cd34a8e98 Mon Sep 17 00:00:00 2001
From: Bruno Haible <[email protected]>
Date: Sat, 9 Sep 2017 01:04:08 +0200
Subject: [PATCH 09/16] gnulib-tool.py: follow gnulib-tool changes, part 5

Follow gnulib-tool change from 2013-05-04
"Assume gnulib is checked out from Git, not CVS"
---
 ChangeLog                  | 2 +-
 pygnulib/GLInfo.py         | 2 +-
 pygnulib/GLModuleSystem.py | 4 +---
 pygnulib/GLTestDir.py      | 6 +-----
 4 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 68d3205..959483d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -13629,7 +13629,7 @@ o	Test only that noncanonical values do not cause crashes, not that
 	* modules/renameat: Likewise.  Also delete fstat.
 	URL: http://bugs.gentoo.org/468790
 
-2012-05-04  Stefano Lattarini  <[email protected]>
+2013-05-04  Stefano Lattarini  <[email protected]>
 
 	Assume gnulib is checked out from Git, not CVS
 
diff --git a/pygnulib/GLInfo.py b/pygnulib/GLInfo.py
index baec6af..f992ba6 100644
--- a/pygnulib/GLInfo.py
+++ b/pygnulib/GLInfo.py
@@ -291,7 +291,7 @@ Report bugs to <[email protected]>.'''
         return(result)
 
     def version(self):
-        '''Return formatted string which contains git or CVS version.'''
+        '''Return formatted string which contains git version.'''
         if isdir(DIRS['git']):
             version_gen = joinpath(DIRS['build-aux'], 'git-version-gen')
             args = [version_gen, DIRS['root']]
diff --git a/pygnulib/GLModuleSystem.py b/pygnulib/GLModuleSystem.py
index 2a2c8cd..6dab6dd 100644
--- a/pygnulib/GLModuleSystem.py
+++ b/pygnulib/GLModuleSystem.py
@@ -84,7 +84,7 @@ class GLModuleSystem(object):
             raise(TypeError(
                 'module must be a string, not %s' % type(module).__name__))
         result = bool()
-        badnames = ['CVS', 'ChangeLog', 'COPYING', 'README', 'TEMPLATE',
+        badnames = ['ChangeLog', 'COPYING', 'README', 'TEMPLATE',
                     'TEMPLATE-EXTENDED', 'TEMPLATE-TESTS']
         if isfile(joinpath(DIRS['modules'], module)) or \
                 all([  # Begin all(iterable) function
@@ -132,8 +132,6 @@ class GLModuleSystem(object):
             [
                 'sed',
                 '-e', r's,^modules/,,',
-                '-e', r'/^CVS\//d',
-                '-e', r'/\/CVS\//d',
                 '-e', r'/^ChangeLog$/d',
                 '-e', r'/\/ChangeLog$/d',
                 '-e', r'/^COPYING$/d',
diff --git a/pygnulib/GLTestDir.py b/pygnulib/GLTestDir.py
index 2937b5d..8e49a91 100644
--- a/pygnulib/GLTestDir.py
+++ b/pygnulib/GLTestDir.py
@@ -907,11 +907,7 @@ class GLMegaTestDir(object):
         repdict['Oct'] = repdict['October'] = '10'
         repdict['Nov'] = repdict['November'] = '11'
         repdict['Dec'] = repdict['December'] = '12'
-        if isfile(joinpath(DIRS['root'], 'CVS', 'Entries')):
-            vc_witness = joinpath(DIRS['root'], 'CVS', 'Entries')
-        else:  # if not isfile(joinpath(DIRS['root'], 'CVS', 'Entries'))
-            vc_witness = joinpath(
-                DIRS['root'], '.git', 'refs', 'heads', 'master')
+        vc_witness = joinpath(DIRS['root'], '.git', 'refs', 'heads', 'master')
         mdate_sh = joinpath(DIRS['root'], 'build-aux', 'mdate-sh')
         args = ['sh', mdate_sh, vc_witness]
         cvsdate = sp.check_output(args).decode("UTF-8").strip()
-- 
2.7.4

>From ea4cb570711f0fd6f499b331f8fdcaf5ad2a19c5 Mon Sep 17 00:00:00 2001
From: Bruno Haible <[email protected]>
Date: Sat, 9 Sep 2017 01:06:34 +0200
Subject: [PATCH 10/16] gnulib-tool.py: follow gnulib-tool changes, part 6

Follow gnulib-tool change from 2013-05-10
"deps: require Automake >= 1.9.6 in generated Makefile fragments"
---
 ChangeLog             | 2 +-
 pygnulib/GLEmiter.py  | 4 ++--
 pygnulib/GLTestDir.py | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 959483d..20afb20 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -13581,7 +13581,7 @@ o	Test only that noncanonical values do not cause crashes, not that
 	maint.mk: catch more abuse of HAVE_DECL in syntax-check
 	* top/maint.mk (sc_prohibit_defined_have_decl_tests): Relax regex.
 
-2012-05-10  Stefano Lattarini  <[email protected]>
+2013-05-10  Stefano Lattarini  <[email protected]>
 
 	deps: require Automake >= 1.9.6 in generated Makefile fragments
 
diff --git a/pygnulib/GLEmiter.py b/pygnulib/GLEmiter.py
index 178cdee..daefeca 100644
--- a/pygnulib/GLEmiter.py
+++ b/pygnulib/GLEmiter.py
@@ -756,7 +756,7 @@ AC_DEFUN([%V1%_LIBSOURCES], [
             # object files (example: hash.c and libxml/hash.c).
             if uses_subdirs:
                 subdir_options = string(' subdir-objects')
-            emit += 'AUTOMAKE_OPTIONS = 1.5 gnits%s\n' % subdir_options
+            emit += 'AUTOMAKE_OPTIONS = 1.9.6 gnits%s\n' % subdir_options
         emit += '\n'
         if not makefile:
             emit += 'SUBDIRS =\n'
@@ -1045,7 +1045,7 @@ AC_DEFUN([%V1%_LIBSOURCES], [
         subdir_options = string()
         if uses_subdirs:
             subdir_options = string(' subdir-objects')
-        emit += 'AUTOMAKE_OPTIONS = 1.5 foreign%s\n\n' % subdir_options
+        emit += 'AUTOMAKE_OPTIONS = 1.9.6 foreign%s\n\n' % subdir_options
         if for_test and not single_configure:
             emit += 'ACLOCAL_AMFLAGS = -I %s/%s\n\n' % (
                 testsbase_inverse, m4base)
diff --git a/pygnulib/GLTestDir.py b/pygnulib/GLTestDir.py
index 8e49a91..6140750 100644
--- a/pygnulib/GLTestDir.py
+++ b/pygnulib/GLTestDir.py
@@ -521,7 +521,7 @@ class GLTestDir(object):
         # Create Makefile.am.
         emit = string()
         emit += '## Process this file with automake to produce Makefile.in.\n\n'
-        emit += 'AUTOMAKE_OPTIONS = 1.5 foreign\n\n'
+        emit += 'AUTOMAKE_OPTIONS = 1.9.6 foreign\n\n'
         emit += 'SUBDIRS = %s\n\n' % ' '.join(subdirs)
         emit += 'ACLOCAL_AMFLAGS = -I %s\n' % m4base
         emit = constants.nlconvert(emit)
@@ -949,7 +949,7 @@ class GLMegaTestDir(object):
         # Create Makefile.am.
         emit = string()
         emit += '## Process this file with automake to produce Makefile.in.\n\n'
-        emit += 'AUTOMAKE_OPTIONS = 1.5 foreign\n\n'
+        emit += 'AUTOMAKE_OPTIONS = 1.9.6 foreign\n\n'
         emit += 'SUBDIRS = %s\n\n' % ' '.join(megasubdirs)
         emit += 'EXTRA_DIST = do-autobuild\n'
         emit = constants.nlconvert(emit)
-- 
2.7.4

>From 6052ea380c30ed375ffc85ab090407028de267bf Mon Sep 17 00:00:00 2001
From: Bruno Haible <[email protected]>
Date: Sat, 9 Sep 2017 01:09:45 +0200
Subject: [PATCH 11/16] gnulib-tool.py: follow gnulib-tool changes, part 7

Follow gnulib-tool change from 2014-05-27
"gnulib-tool: adjust translation wget to avoid a https redirection"
---
 pygnulib/GLImport.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pygnulib/GLImport.py b/pygnulib/GLImport.py
index 7522eae..bb8b839 100644
--- a/pygnulib/GLImport.py
+++ b/pygnulib/GLImport.py
@@ -1212,7 +1212,7 @@ AC_DEFUN([%s_FILE_LIST], [\n''' % macro_prefix
                     args = ['rsync', '-Lrtz', '%sgnulib/' % TP_RSYNC_URI, '.']
                 else:  # use wget
                     args = ['wget', '--quiet', '-r', '-l1', '-nd', '-np', '-A.po',
-                            '%sgnulib' % TP_URL]
+                            '%sgnulib/' % TP_URL]
                 sp.call(args, shell=True)
             else:  # if self.config['dryrun']
                 print('Fetch gnulib PO files from %s' % TP_URL)
-- 
2.7.4

>From 924491eb9a292786ee3b5611e2beb97b8797592e Mon Sep 17 00:00:00 2001
From: Bruno Haible <[email protected]>
Date: Sat, 9 Sep 2017 01:16:46 +0200
Subject: [PATCH 12/16] gnulib-tool.py: follow gnulib-tool changes, part 8

Follow gnulib-tool change from 2014-05-27
"gnulib-tool: wget translations using --no-verbose rather than --quiet"
---
 pygnulib/GLImport.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pygnulib/GLImport.py b/pygnulib/GLImport.py
index bb8b839..d5f5ea6 100644
--- a/pygnulib/GLImport.py
+++ b/pygnulib/GLImport.py
@@ -1211,7 +1211,7 @@ AC_DEFUN([%s_FILE_LIST], [\n''' % macro_prefix
                 if result:  # use rsync
                     args = ['rsync', '-Lrtz', '%sgnulib/' % TP_RSYNC_URI, '.']
                 else:  # use wget
-                    args = ['wget', '--quiet', '-r', '-l1', '-nd', '-np', '-A.po',
+                    args = ['wget', '--no-verbose', '-r', '-l1', '-nd', '-np', '-A.po',
                             '%sgnulib/' % TP_URL]
                 sp.call(args, shell=True)
             else:  # if self.config['dryrun']
-- 
2.7.4

>From d343de60a9d6d30226a2a1e2a8ad271b7df77aae Mon Sep 17 00:00:00 2001
From: Bruno Haible <[email protected]>
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

>From f4c1a10d29948da5d8b3dda0866804ef515f7f63 Mon Sep 17 00:00:00 2001
From: Bruno Haible <[email protected]>
Date: Sat, 9 Sep 2017 01:36:16 +0200
Subject: [PATCH 14/16] gnulib-tool.py: follow gnulib-tool changes, part 10

Follow gnulib-tool change from 2014-09-05
"gnulib-tool: Use same options as build-aux/bootstrap to download PO files."
---
 pygnulib/GLImport.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pygnulib/GLImport.py b/pygnulib/GLImport.py
index 125ee9d..4352a7e 100644
--- a/pygnulib/GLImport.py
+++ b/pygnulib/GLImport.py
@@ -1207,10 +1207,10 @@ AC_DEFUN([%s_FILE_LIST], [\n''' % macro_prefix
                 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, '.']
+                    args = ['rsync', '--delete', '--exclude', '*.s1', '-Lrtz', '%sgnulib/' % TP_RSYNC_URI, '.']
                     result = sp.call(args, shell=True)
                 if result != 0:  # use wget
-                    args = ['wget', '--no-verbose', '-r', '-l1', '-nd', '-np', '-A.po',
+                    args = ['wget', '--no-verbose', '--mirror', '-nd', '-np', '-A.po', '-P', '.',
                             '%sgnulib/' % TP_URL]
                     sp.call(args, shell=True)
             else:  # if self.config['dryrun']
-- 
2.7.4

>From 0c0376e76e6448d01a41a9cfe2e568a5411c07ad Mon Sep 17 00:00:00 2001
From: Bruno Haible <[email protected]>
Date: Sat, 9 Sep 2017 10:21:00 +0200
Subject: [PATCH 15/16] gnulib-tool.py: follow gnulib-tool changes, part 11

Follow gnulib-tool change from 2014-12-02
"gnulib-tool: recognize x:* as an absolute path"
---
 pygnulib/constants.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pygnulib/constants.py b/pygnulib/constants.py
index 6cb1ec9..9e0f194 100644
--- a/pygnulib/constants.py
+++ b/pygnulib/constants.py
@@ -344,16 +344,16 @@ def link_relative(src, dest):
     else:  # if dest has not bytes or string type
         raise(TypeError(
             'dest must be a string, not %s' % (type(dest).__name__)))
-    if src.startswith('/'):
+    if src.startswith('/') or (len(src) >= 2 and src[1] == ':'):
         os.symlink(src, dest)
-    else:  # if not src.startswith('/')
-        if dest.startswith('/'):
+    else:  # if src is not absolute
+        if dest.startswith('/') or (len(dest) >= 2 and dest[1] == ':'):
             if not constants.PYTHON3:
                 cwd = os.getcwdu()
             else:  # if constants.PYTHON3
                 cwd = os.getcwd()
             os.symlink(joinpath(cwd, src), dest)
-        else:  # if not dest.startswith('/')
+        else:  # if dest is not absolute
             destdir = os.path.dirname(dest)
             if not destdir:
                 destdir = '.'
-- 
2.7.4

>From 1ebd64a2769e24fb9d41c8d133b58111ee94152d Mon Sep 17 00:00:00 2001
From: Bruno Haible <[email protected]>
Date: Sat, 9 Sep 2017 10:25:09 +0200
Subject: [PATCH 16/16] gnulib-tool.py: follow gnulib-tool changes, part 12

Follow gnulib-tool change from 2015-02-03
"gnulib-tool: fix handling of patch(1) diagnostics"
---
 pygnulib/GLFileSystem.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pygnulib/GLFileSystem.py b/pygnulib/GLFileSystem.py
index 7db09e1..1e75206 100644
--- a/pygnulib/GLFileSystem.py
+++ b/pygnulib/GLFileSystem.py
@@ -99,7 +99,7 @@ class GLFileSystem(object):
             if isfile(path_gnulib):
                 if self.config['localdir'] and isfile(path_diff):
                     shutil.copy(path_gnulib, path_temp)
-                    command = 'patch -s "%s" < "%s"' % (path_temp, path_diff)
+                    command = 'patch -s "%s" < "%s" >&2' % (path_temp, path_diff)
                     try:  # Try to apply patch
                         sp.check_call(command, shell=True)
                     except sp.CalledProcessError as error:
-- 
2.7.4

Reply via email to