bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] gnulib-tool.py: Follow gnulib-tool changes, part 65.


From: Collin Funk
Subject: [PATCH] gnulib-tool.py: Follow gnulib-tool changes, part 65.
Date: Mon, 18 Mar 2024 12:44:14 -0700
User-agent: Mozilla Thunderbird

Hey Bruno,

I *think* I did this patch correctly, but there are some code ordering
differences which are slightly confusing. I'm not sure if they can
cause issues or not.

Most of the changes in 'GLImport.py' are just translations of the
shell version. I've made one style change:

-        current_edit = int()
+        current_edit = 0

I've just changed it now since it was confusing to me and there are no
other occurrences of this convention.

In gnulib-tool.sh AC_CONFIG_AUX_DIR, A[CM]_PROG_LIBTOOL,
AC_CONFIG_MACRO_DIR, and AC_CONFIG_MACRO_DIRS are checked under:

import | add-import | remove-import | update ) ;;

In the Python version currently we check for AC_CONFIG_AUX_DIR and
A[CM]_PROG_LIBTOOL in GLImport.__init__(). This patch adds the checks
for AC_CONFIG_MACRO_DIR and AC_CONFIG_MACRO_DIRS in main() under:

elif mode in ['import', 'add-import', 'remove-import', 'update']:

Can the AC_CONFIG_AUX_DIR and A[CM]_PROG_LIBTOOL being checked in
every new GLImport cause any issues?

Also, I think my progress learning 'sed' is going well. :)
I am fairly confident I translated the backslashes correctly:

pattern = re.compile(r'^.*AC_CONFIG_MACRO_DIRS?\([\[ ]*([^\]"\$`\\\)]*).*$', 
re.MULTILINE)
print(pattern.findall('''AC_CONFIG_MACRO_DIR([dir1])dnl
AC_CONFIG_MACRO_DIRS(    [dir2]  )
AC_CONFIG_MACRO_DIR(    [dir3]   )'''))
['dir1', 'dir2', 'dir3']

Collin

Attachment: 0001-gnulib-tool.py-Follow-gnulib-tool-changes-part-65.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]