diff options
author | Bruno Haible <bruno@clisp.org> | 2022-08-13 13:18:06 +0200 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2022-08-13 13:18:06 +0200 |
commit | 01cd78f9d682ff75cc5ab1c2d21b911bdd9215b8 (patch) | |
tree | e408b1a934167dd5cdcdad75713a263e41e51858 /pygnulib/GLTestDir.py | |
parent | 2c984879f02633334ccf80512ad1034dcc9cb922 (diff) | |
download | gnulib-01cd78f9d682ff75cc5ab1c2d21b911bdd9215b8.tar.gz |
gnulib-tool.py: Reduce code duplication.
* pygnulib/constants.py (relinverse): New function.
* pygnulib/GLEmiter.py (GLEmiter.po_Makevars,
GLEmiter.tests_Makefile_am): Use it.
* pygnulib/GLTestDir.py (GLTestDir.execute): Likewise.
Diffstat (limited to 'pygnulib/GLTestDir.py')
-rw-r--r-- | pygnulib/GLTestDir.py | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/pygnulib/GLTestDir.py b/pygnulib/GLTestDir.py index bf00099283..68cc5ce411 100644 --- a/pygnulib/GLTestDir.py +++ b/pygnulib/GLTestDir.py @@ -48,6 +48,7 @@ DIRS = constants.DIRS UTILS = constants.UTILS TESTS = constants.TESTS joinpath = constants.joinpath +relinverse = constants.relinverse copyfile = constants.copyfile movefile = constants.movefile isdir = os.path.isdir @@ -405,16 +406,7 @@ class GLTestDir(object): file.write(emit) # Viewed from the $testsbase subdirectory, $auxdir is different. emit = '' - saved_auxdir = self.config['auxdir'] - testsbase = '%s/' % os.path.normpath(testsbase) - counter = int() - auxdir = '' - finish = (len(testsbase.split('/')) - 1) - while counter < finish: - auxdir += '../' - counter += 1 - auxdir = os.path.normpath(joinpath(auxdir, saved_auxdir)) - testsbase = os.path.normpath(testsbase) + auxdir = os.path.normpath(joinpath(relinverse(testsbase), auxdir)) self.config.setAuxDir(auxdir) # Create $testsbase/configure.ac. emit += '# Process this file with autoconf ' |