Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: [PATCH 1/4] [gdb] Handle empty list in update_files in copyright.py
Date: Wed, 29 Apr 2026 10:13:34 +0200	[thread overview]
Message-ID: <20260429081337.1563201-2-tdevries@suse.de> (raw)
In-Reply-To: <20260429081337.1563201-1-tdevries@suse.de>

Function update_files in copyright.py can be called with an update_list
such that len(list(update_list)) == 0.  If so, the function hangs.

Fix this by:
- converting iterable update_list to a list, and
- bailing out if len == 0.
---
 gdb/copyright.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/gdb/copyright.py b/gdb/copyright.py
index 94a1dfc91de..cf838453c45 100755
--- a/gdb/copyright.py
+++ b/gdb/copyright.py
@@ -87,6 +87,13 @@ def update_files(update_list: Iterable[str]):
 
     We use gnulib's update-copyright script for that.
     """
+
+    update_list = list(update_list)
+    if not update_list:
+        # When running gnulib/import/extra/update-copyright with no arguments,
+        # it reads from stdin, causing a hang.
+        return
+
     # We want to use year intervals in the copyright notices, and
     # all years should be collapsed to one single year interval,
     # even if there are "holes" in the list of years found in the
-- 
2.51.0


  reply	other threads:[~2026-04-29  8:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-29  8:13 [PATCH 0/4] [pre-commit] Add copyright-years check Tom de Vries
2026-04-29  8:13 ` Tom de Vries [this message]
2026-04-29  8:13 ` [PATCH 2/4] [gdb] Factor out filter_excluded out of update_files in copyright.py Tom de Vries
2026-04-29  8:13 ` [PATCH 3/4] [gdb] Require python >= 3.13 " Tom de Vries
2026-04-29  8:13 ` [PATCH 4/4] [pre-commit] Add copyright-years check Tom de Vries
2026-06-01 13:23   ` Tom de Vries
2026-06-01 13:10 ` [PING] [PATCH 0/4] " Tom de Vries

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

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

  git send-email \
    --in-reply-to=20260429081337.1563201-2-tdevries@suse.de \
    --to=tdevries@suse.de \
    --cc=gdb-patches@sourceware.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