Hey Bruno,

On 3/12/24 10:07 AM, Collin Funk wrote:
> Yeah, I can see that becoming an issue. Some areas the backslashes get
> confusing as well. I had to run the test case a few times to convince
> myself I got it correct...

Well, that is a bit embarrassing. It looks like I spoke too soon.

/home/collin/.local/src/gnulib/pygnulib/GLEmiter.py:620: SyntaxWarning: invalid 
escape sequence '\$'
  libobjdeps = f'{macro_prefix_arg}_libobjdeps="${macro_prefix_arg}_libobjdeps 
{subdir}$i_dir/\$(DEPDIR)/$i_base.Plo"'
/home/collin/.local/src/gnulib/pygnulib/GLEmiter.py:622: SyntaxWarning: invalid 
escape sequence '\$'
  libobjdeps = f'{macro_prefix_arg}_libobjdeps="${macro_prefix_arg}_libobjdeps 
{subdir}$i_dir/\$(DEPDIR)/$i_base.Po"'

The output of configure.ac was still correct, but the '\$(DEPDIR)' on
each line should be '\\$(DEPDIR)'. I didn't notice the warnings since
the subsequent copy file messages pushed them off my terminal.

I've attached a fix. Sorry about that.

Collin
From d8a9305efb3a9ca907bb94f420eebddf36884ab4 Mon Sep 17 00:00:00 2001
From: Collin Funk <collin.fu...@gmail.com>
Date: Tue, 12 Mar 2024 11:45:53 -0700
Subject: [PATCH] gnulib-tool.py: Fix last commit.

* pygnulib/GLEmiter.py (GLEmiter.initmacro_end): Silence Python
warnings about invalid escape. Make sure to escape the backslash
character we want to print.
---
 ChangeLog            | 7 +++++++
 pygnulib/GLEmiter.py | 4 ++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index ac803c2e18..180ca802cd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2024-03-12  Collin Funk  <collin.fu...@gmail.com>
+
+	gnulib-tool.py: Fix last commit.
+	* pygnulib/GLEmiter.py (GLEmiter.initmacro_end): Silence Python
+	warnings about invalid escape. Make sure to escape the backslash
+	character we want to print.
+
 2024-03-12  Collin Funk  <collin.fu...@gmail.com>
 
 	gnulib-tool.py: Follow gnulib-tool changes, part 55.
diff --git a/pygnulib/GLEmiter.py b/pygnulib/GLEmiter.py
index c403df6141..bd678fc4af 100644
--- a/pygnulib/GLEmiter.py
+++ b/pygnulib/GLEmiter.py
@@ -617,9 +617,9 @@ USE_MSGCTXT = no\n"""
         else:
             subdir = ''
         if libtool:
-            libobjdeps = f'{macro_prefix_arg}_libobjdeps="${macro_prefix_arg}_libobjdeps {subdir}$i_dir/\$(DEPDIR)/$i_base.Plo"'
+            libobjdeps = f'{macro_prefix_arg}_libobjdeps="${macro_prefix_arg}_libobjdeps {subdir}$i_dir/\\$(DEPDIR)/$i_base.Plo"'
         else:
-            libobjdeps = f'{macro_prefix_arg}_libobjdeps="${macro_prefix_arg}_libobjdeps {subdir}$i_dir/\$(DEPDIR)/$i_base.Po"'
+            libobjdeps = f'{macro_prefix_arg}_libobjdeps="${macro_prefix_arg}_libobjdeps {subdir}$i_dir/\\$(DEPDIR)/$i_base.Po"'
         emit += fr'''
   m4_ifval({macro_prefix_arg}_LIBSOURCES_LIST, [
     m4_syscmd([test ! -d ]m4_defn([{macro_prefix_arg}_LIBSOURCES_DIR])[ ||
-- 
2.44.0

Reply via email to