From: Bruno Haible Date: Sun, 17 Mar 2024 12:46:04 +0000 (+0100) Subject: gnulib-tool: Add undocumented option --gnulib-dir. X-Git-Tag: v1.0~275 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ac3f25163388ecee278d681bf65963c781ae5df2;p=thirdparty%2Fgnulib.git gnulib-tool: Add undocumented option --gnulib-dir. * gnulib-tool.sh: Accept --gnulib-dir=... option. * pygnulib/constants.py (init_DIRS): New function. * pygnulib/main.py (main): Accept --gnulib-dir=... option. Invoke init_DIRS. Expect .git directory to be present in DIRS['root'], not APP['root']. * pygnulib/GLImport.py (GLImport.execute): Use DIRS['root'], not APP['root']. --- diff --git a/ChangeLog b/ChangeLog index 6ab70181bb..e64d11c178 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2024-03-17 Bruno Haible + + gnulib-tool: Add undocumented option --gnulib-dir. + * gnulib-tool.sh: Accept --gnulib-dir=... option. + * pygnulib/constants.py (init_DIRS): New function. + * pygnulib/main.py (main): Accept --gnulib-dir=... option. Invoke + init_DIRS. Expect .git directory to be present in DIRS['root'], not + APP['root']. + * pygnulib/GLImport.py (GLImport.execute): Use DIRS['root'], not + APP['root']. + 2024-03-17 Collin Funk gnulib-tool.py: Follow gnulib-tool changes, part 61. diff --git a/gnulib-tool.sh b/gnulib-tool.sh index 62039fb03b..96869f80d6 100755 --- a/gnulib-tool.sh +++ b/gnulib-tool.sh @@ -1526,6 +1526,10 @@ func_determine_path_separator --version | --versio | --versi | --vers ) func_version func_exit $? ;; + # Undocumented option. Only used for the gnulib-tool test suite. + --gnulib-dir=* ) + gnulib_dir=`echo "X$1" | sed -e 's/^X--gnulib-dir=//'` + shift ;; -- ) # Stop option processing shift diff --git a/pygnulib/GLImport.py b/pygnulib/GLImport.py index c65ba7d3f7..c06f0f9f6b 100644 --- a/pygnulib/GLImport.py +++ b/pygnulib/GLImport.py @@ -1191,7 +1191,7 @@ AC_DEFUN([%s_FILE_LIST], [\n''' % macro_prefix self.moduletable['main'], self.moduletable, self.makefiletable, actioncmd, for_test) if automake_subdir: - emit = sp.run([joinpath(APP['root'], 'build-aux/prefix-gnulib-mk'), '--from-gnulib-tool', + emit = sp.run([joinpath(DIRS['root'], 'build-aux/prefix-gnulib-mk'), '--from-gnulib-tool', f'--lib-name={libname}', f'--prefix={sourcebase}/'], input=emit, text=True, capture_output=True).stdout with codecs.open(tmpfile, 'wb', 'UTF-8') as file: diff --git a/pygnulib/constants.py b/pygnulib/constants.py index dc2e68069d..975b0e7da2 100644 --- a/pygnulib/constants.py +++ b/pygnulib/constants.py @@ -77,17 +77,18 @@ APP['root'] = os.path.dirname(os.path.dirname(APP['path'])) # file name of