bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Collin Funk <collin.funk1@gmail.com>
To: bug-gnulib@gnu.org
Subject: gnulib-tool.py: Make temporary directories recognizable.
Date: Sun, 21 Apr 2024 00:55:54 -0700	[thread overview]
Message-ID: <bc2fee6d-9591-444c-9a66-2493989bb695@gmail.com> (raw)

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

This patch prefixes temporary directories created by gnulib-tool.py
with "glpy". gnulib-tool.sh uses the 'gl' prefix in func_tmpdir, and I
suppose it is beneficial to differentiate the two.

I probably should have done this ~2 months ago when gnulib-tool.py
crashed frequently. After testing my /tmp would be full of directories
named with the template "tmpXXXXXXXX", which I assume gets used by
other programs too. Thankfully that is less of an issue now since
gnulib-tool.py crashes less...

Collin

[-- Attachment #2: 0001-gnulib-tool.py-Make-temporary-directories-recognizab.patch --]
[-- Type: text/x-patch, Size: 1492 bytes --]

From 68e59ded4b879011d2a8b3ff3b3342225dcdf312 Mon Sep 17 00:00:00 2001
From: Collin Funk <collin.funk1@gmail.com>
Date: Sun, 21 Apr 2024 00:29:50 -0700
Subject: [PATCH] gnulib-tool.py: Make temporary directories recognizable.

* pygnulib/GLConfig.py (GLConfig.__init__): Pass the 'glpy' prefix to
mkdtemp.
---
 ChangeLog            | 6 ++++++
 pygnulib/GLConfig.py | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 6523c89b87..502cdeeaeb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-04-21  Collin Funk  <collin.funk1@gmail.com>
+
+	gnulib-tool.py: Make temporary directories recognizable.
+	* pygnulib/GLConfig.py (GLConfig.__init__): Pass the 'glpy' prefix to
+	mkdtemp.
+
 2024-04-20  Collin Funk  <collin.funk1@gmail.com>
 
 	gnulib-tool.py: Don't fail when given a bad module name.
diff --git a/pygnulib/GLConfig.py b/pygnulib/GLConfig.py
index 19611b823c..05947e8ed3 100644
--- a/pygnulib/GLConfig.py
+++ b/pygnulib/GLConfig.py
@@ -87,7 +87,7 @@ def __init__(self,
                  errors: bool | None = None) -> None:
         '''Create new GLConfig instance.'''
         self.table = dict()
-        self.table['tempdir'] = tempfile.mkdtemp()
+        self.table['tempdir'] = tempfile.mkdtemp(prefix='glpy')
         # Check and store the attributes.
         # Remove trailing slashes from the directory names. This is necessary
         # for m4base (to avoid an error in func_import) and optional for the
-- 
2.44.0


             reply	other threads:[~2024-04-21  7:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-21  7:55 Collin Funk [this message]
2024-04-21 11:41 ` gnulib-tool.py: Make temporary directories recognizable 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=bc2fee6d-9591-444c-9a66-2493989bb695@gmail.com \
    --to=collin.funk1@gmail.com \
    --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).