From b5850cf209fc597150fb196067674c8c41857316 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 6 Aug 2022 03:06:51 +0200 Subject: gnulib-tool.py: Finish implementing option --po-domain. * gnulib-tool.py (main): Accept option --po-domain. * pygnulib/GLEmiter.py (GLEmiter.po_POTFILES_in): Fix variable reference. * pygnulib/GLImport.py (GLImport.execute): Don't delete Makefile.in.in from the gnulib directory. Don't require a shell when invoking wget. After invoking wget, restore the current directory. --- pygnulib/GLImport.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'pygnulib/GLImport.py') diff --git a/pygnulib/GLImport.py b/pygnulib/GLImport.py index dda10c1b76..9de4b3b93c 100644 --- a/pygnulib/GLImport.py +++ b/pygnulib/GLImport.py @@ -42,10 +42,12 @@ __copyright__ = constants.__copyright__ #=============================================================================== # Define global constants #=============================================================================== +DIRS = constants.DIRS MODES = constants.MODES TESTS = constants.TESTS joinpath = constants.joinpath cleaner = constants.cleaner +copyfile = constants.copyfile copyfile2 = constants.copyfile2 movefile = constants.movefile isabs = os.path.isabs @@ -1161,7 +1163,7 @@ AC_DEFUN([%s_FILE_LIST], [\n''' % macro_prefix tmpfile = self.assistant.tmpfilename(joinpath(pobase, file)) path = joinpath('build-aux', 'po', file) lookedup, flag = filesystem.lookup(path) - movefile(lookedup, tmpfile) + copyfile(lookedup, tmpfile) basename = joinpath(pobase, file) filename, backup, flag = self.assistant.super_update(basename, tmpfile) if flag == 1: @@ -1227,7 +1229,8 @@ AC_DEFUN([%s_FILE_LIST], [\n''' % macro_prefix os.chdir(joinpath(destdir, pobase)) args = ['wget', '--no-verbose', '--mirror', '--level=1', '-nd', '-A.po', '-P', '.', '%sgnulib/' % TP_URL] - sp.call(args, shell=True) + sp.call(args) + os.chdir(DIRS['cwd']) else: # if self.config['dryrun'] print('Fetch gnulib PO files from %s' % TP_URL) @@ -1236,8 +1239,8 @@ AC_DEFUN([%s_FILE_LIST], [\n''' % macro_prefix if not self.config['dryrun']: tmpfile = self.assistant.tmpfilename(basename) data = '# Set of available languages.\n' - files = [constants.subend('.po', '', file) - for file in os.listdir(joinpath(destdir, pobase))] + files = [ constants.subend('.po', '', file) + for file in os.listdir(joinpath(destdir, pobase)) ] data += '\n'.join(files) with codecs.open(tmpfile, 'wb', 'UTF-8') as file: file.write(data) -- cgit v1.2.1