bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Collin Funk <collin.funk1@gmail.com>
To: Bruno Haible <bruno@clisp.org>, bug-gnulib@gnu.org
Subject: Re: [PATCH] gnulib-tool.py: Comment out undefined variable.
Date: Wed, 21 Feb 2024 09:17:47 -0800	[thread overview]
Message-ID: <9a1409b7-27bc-4c46-af40-c9bc41cccfaf@gmail.com> (raw)
In-Reply-To: <4938842.YqazSvReao@nimes>

[-- Attachment #1: Type: text/plain, Size: 1118 bytes --]

On 2/21/24 8:08 AM, Bruno Haible wrote:
> I suppose it is not much more work to fix this line for real?
> Hints:
>   - If there is no variable 'saved_auxdir' in this function, maybe there
>     is a variable 'auxdir'?
>   - What do the comments hint at?
>   - What does the history of the file ('gitk pygnulib/GLTestDir.py',
>     'git annotate pygnulib/GLTestDir.py') tell you?

Thanks for the tips. I should have done that in the first place...
I think that this patch would be the correct way to fix the issue.

It seems that your commit 01cd78f9d682ff75cc5ab1c2d21b911bdd9215b8
accidentally caused this. While cleaning up the handling of paths, I
think you accidentally removed this variable. This patch seems to
restore the behavior of the previous commits.

Then:
	gnulib-tool --create-testdir --dir t1 dummy
	gnulib-tool.py --create-testdir --dir t2 dummy

Both t1/gltests/configure.ac and t2/gltests/configure.ac start with:

# Process this file with autoconf to produce a configure script.
AC_INIT([dummy], [0])
AC_CONFIG_AUX_DIR([../build-aux])
AM_INIT_AUTOMAKE

Not a complete test but better than before :)

[-- Attachment #2: 0001-gnulib-tool.py-Fix-undefined-variable-while-emitting.patch --]
[-- Type: text/x-patch, Size: 1742 bytes --]

From b2ee9537298dd76d683ec9c4298f22c53f45f6f5 Mon Sep 17 00:00:00 2001
From: Collin Funk <collin.funk1@gmail.com>
Date: Wed, 21 Feb 2024 08:54:51 -0800
Subject: [PATCH] gnulib-tool.py: Fix undefined variable while emitting
 testdir.

* pygnulib/GLTestDir.py (GLTestDir.execute): Fix undefined
variable refrence caused by commit
01cd78f9d682ff75cc5ab1c2d21b911bdd9215b8.
Restore the previous auxdir when finished writing the
configure.ac file in the test directory.
---
 ChangeLog             | 9 +++++++++
 pygnulib/GLTestDir.py | 1 +
 2 files changed, 10 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 9779a09ac6..e313032178 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2024-02-21  Collin Funk  <collin.funk1@gmail.com>
+
+	gnulib-tool.py: Fix undefined variable while emitting testdir.
+	* pygnulib/GLTestDir.py (GLTestDir.execute): Fix undefined
+	variable refrence caused by commit
+	01cd78f9d682ff75cc5ab1c2d21b911bdd9215b8.
+	Restore the previous auxdir when finished writing the
+	configure.ac file in the test directory.
+
 2024-02-21  Bruno Haible  <bruno@clisp.org>
 
 	*printf-posix: Disable support for the 'n' directive by default.
diff --git a/pygnulib/GLTestDir.py b/pygnulib/GLTestDir.py
index ae8537cff4..144798bd01 100644
--- a/pygnulib/GLTestDir.py
+++ b/pygnulib/GLTestDir.py
@@ -406,6 +406,7 @@ class GLTestDir(object):
                     file.write(emit)
                 # Viewed from the $testsbase subdirectory, $auxdir is different.
                 emit = ''
+                saved_auxdir = auxdir
                 auxdir = os.path.normpath(joinpath(relinverse(testsbase), auxdir))
                 self.config.setAuxDir(auxdir)
                 # Create $testsbase/configure.ac.
-- 
2.39.2


  reply	other threads:[~2024-02-21 17:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-21 11:36 [PATCH] gnulib-tool.py: Comment out undefined variable Collin Funk
2024-02-21 16:08 ` Bruno Haible
2024-02-21 17:17   ` Collin Funk [this message]
2024-02-21 17:29     ` Bruno Haible

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9a1409b7-27bc-4c46-af40-c9bc41cccfaf@gmail.com \
    --to=collin.funk1@gmail.com \
    --cc=bruno@clisp.org \
    --cc=bug-gnulib@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).