summaryrefslogtreecommitdiff
path: root/pygnulib
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2022-08-06 03:06:51 +0200
committerBruno Haible <bruno@clisp.org>2022-08-06 03:06:51 +0200
commitb5850cf209fc597150fb196067674c8c41857316 (patch)
treec95910ff4d5bacddca77cc8f4432810c9c2d4a7f /pygnulib
parentbfc5329c890031833022bc78b5f0e793a53f5be6 (diff)
downloadgnulib-b5850cf209fc597150fb196067674c8c41857316.tar.gz
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.
Diffstat (limited to 'pygnulib')
-rw-r--r--pygnulib/GLEmiter.py3
-rw-r--r--pygnulib/GLImport.py11
2 files changed, 8 insertions, 6 deletions
diff --git a/pygnulib/GLEmiter.py b/pygnulib/GLEmiter.py
index 9d9ca458ee..b6c31fa603 100644
--- a/pygnulib/GLEmiter.py
+++ b/pygnulib/GLEmiter.py
@@ -444,8 +444,7 @@ USE_MSGCTXT = no\n"""
Emit the file list to be passed to xgettext.
GLConfig: sourcebase.'''
emit = ''
- sourcebase = self.config['sourcebase']
- sourcebase = '%s%s' % (self.sourcebase, os.path.sep)
+ sourcebase = self.config['sourcebase'] + os.path.sep
files = [ constants.substart('lib/', sourcebase, file)
for file in files ]
files = [ file
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)