From f6015a5f2416c2e077fc85b94e474a4921f59f04 Mon Sep 17 00:00:00 2001 From: Collin Funk Date: Sat, 6 Apr 2024 05:57:51 -0700 Subject: [PATCH 2/3] gnulib-tool.py: Use auxdir as given by AC_CONFIG_AUX_DIR. * pygnulib/GLImport.py (GLImport.__init__): Don't modify the path given by AC_CONFIG_AUX_DIR by prefixing it with destdir. Use a more strict regular expression instead of cleaner(). --- ChangeLog | 7 +++++++ pygnulib/GLImport.py | 7 +++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index feed5699f7..9e94583721 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2024-04-06 Collin Funk + + gnulib-tool.py: Use auxdir as given by AC_CONFIG_AUX_DIR. + * pygnulib/GLImport.py (GLImport.__init__): Don't modify the path given + by AC_CONFIG_AUX_DIR by prefixing it with destdir. Use a more strict + regular expression instead of cleaner(). + 2024-04-06 Collin Funk gnulib-tool.py: Locate configure.ac correctly when --dir is given. diff --git a/pygnulib/GLImport.py b/pygnulib/GLImport.py index ee238a1615..2776f2c964 100644 --- a/pygnulib/GLImport.py +++ b/pygnulib/GLImport.py @@ -93,11 +93,10 @@ class GLImport: self.cache.setAuxDir('.') with codecs.open(self.config.getAutoconfFile(), 'rb', 'UTF-8') as file: data = file.read() - pattern = re.compile(r'^AC_CONFIG_AUX_DIR\((.*)\)$', re.M) - match = pattern.findall(data) + pattern = re.compile(r'^AC_CONFIG_AUX_DIR\([\[ ]*([^\]"\$`\\\)]+).*?$', re.MULTILINE) + match = pattern.search(data) if match: - result = cleaner(match)[0] - self.cache.setAuxDir(joinpath(self.config['destdir'], result)) + self.cache.setAuxDir(match.group(1)) pattern = re.compile(r'A[CM]_PROG_LIBTOOL', re.M) guessed_libtool = bool(pattern.findall(data)) if self.config['auxdir'] == '': -- 2.44.0