commit:     4ff72634fd6dd4da1c91ececea47aa17133d2b3e
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Dec 18 08:07:34 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Dec 18 08:07:57 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4ff72634

sys-apps/portage: backport Python 3.14 fix

Closes: https://bugs.gentoo.org/967199
Signed-off-by: Sam James <sam <AT> gentoo.org>

 ...ebuild-don-t-define-signal-handlers-in-gl.patch | 77 ++++++++++++++++++++++
 ...e-3.0.73-r1.ebuild => portage-3.0.73-r2.ebuild} |  4 ++
 2 files changed, 81 insertions(+)

diff --git 
a/sys-apps/portage/files/0001-bin-emerge-ebuild-don-t-define-signal-handlers-in-gl.patch
 
b/sys-apps/portage/files/0001-bin-emerge-ebuild-don-t-define-signal-handlers-in-gl.patch
new file mode 100644
index 000000000000..ffe9f944c698
--- /dev/null
+++ 
b/sys-apps/portage/files/0001-bin-emerge-ebuild-don-t-define-signal-handlers-in-gl.patch
@@ -0,0 +1,77 @@
+From d7d6fd54f1c936e89c5e4467c6c1f33b217325ca Mon Sep 17 00:00:00 2001
+Message-ID: 
<d7d6fd54f1c936e89c5e4467c6c1f33b217325ca.1766045192.git....@gentoo.org>
+From: Sam James <[email protected]>
+Date: Tue, 16 Dec 2025 09:36:27 +0000
+Subject: [PATCH] bin: emerge, ebuild: don't define signal handlers in global
+ scope
+
+This breaks when `emerge` is frozen. Do what we do in `egencache`. We
+do need to use the same boilerplate in all bin/* though...
+
+Bug: https://bugs.gentoo.org/941956
+Bug: https://bugs.gentoo.org/967199
+Signed-off-by: Sam James <[email protected]>
+---
+ bin/ebuild | 10 +++++-----
+ bin/emerge | 10 +++++-----
+ 2 files changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/bin/ebuild b/bin/ebuild
+index 0c6369e016..3fc6e334cb 100755
+--- a/bin/ebuild
++++ b/bin/ebuild
+@@ -22,11 +22,6 @@ def debug_signal(_signum, _frame):
+     pdb.set_trace()
+ 
+ 
+-# Prevent "[Errno 32] Broken pipe" exceptions when writing to a pipe.
+-signal.signal(signal.SIGPIPE, signal.SIG_DFL)
+-signal.signal(signal.SIGTERM, signal_interrupt)
+-signal.signal(signal.SIGUSR1, debug_signal)
+-
+ import argparse
+ from os import path as osp
+ import shlex
+@@ -61,6 +56,11 @@ from _emerge.RootConfig import RootConfig
+ 
+ 
+ def main():
++    # Prevent "[Errno 32] Broken pipe" exceptions when writing to a pipe.
++    signal.signal(signal.SIGPIPE, signal.SIG_DFL)
++    signal.signal(signal.SIGTERM, signal_interrupt)
++    signal.signal(signal.SIGUSR1, debug_signal)
++
+     portage.process.sanitize_fds()
+     description = "See the ebuild(1) man page for more info"
+     usage = "Usage: ebuild <ebuild file> <command> [command] ..."
+diff --git a/bin/emerge b/bin/emerge
+index 9e5d59cb04..d4f50fa9a3 100755
+--- a/bin/emerge
++++ b/bin/emerge
+@@ -22,11 +22,6 @@ def debug_signal(_signum, _frame):
+     pdb.set_trace()
+ 
+ 
+-# Prevent "[Errno 32] Broken pipe" exceptions when writing to a pipe.
+-signal.signal(signal.SIGPIPE, signal.SIG_DFL)
+-signal.signal(signal.SIGTERM, signal_interrupt)
+-signal.signal(signal.SIGUSR1, debug_signal)
+-
+ from os import path as osp
+ 
+ if osp.isfile(
+@@ -46,6 +41,11 @@ from _emerge.main import emerge_main
+ 
+ 
+ def main():
++    # Prevent "[Errno 32] Broken pipe" exceptions when writing to a pipe.
++    signal.signal(signal.SIGPIPE, signal.SIG_DFL)
++    signal.signal(signal.SIGTERM, signal_interrupt)
++    signal.signal(signal.SIGUSR1, debug_signal)
++
+     portage.process.sanitize_fds()
+     try:
+         retval = emerge_main()
+-- 
+2.52.0
+

diff --git a/sys-apps/portage/portage-3.0.73-r1.ebuild 
b/sys-apps/portage/portage-3.0.73-r2.ebuild
similarity index 98%
rename from sys-apps/portage/portage-3.0.73-r1.ebuild
rename to sys-apps/portage/portage-3.0.73-r2.ebuild
index 9a5c982c3cb5..b0a1d435740e 100644
--- a/sys-apps/portage/portage-3.0.73-r1.ebuild
+++ b/sys-apps/portage/portage-3.0.73-r2.ebuild
@@ -89,6 +89,10 @@ PDEPEND="
        )
 "
 
+PATCHES=(
+       
"${FILESDIR}"/0001-bin-emerge-ebuild-don-t-define-signal-handlers-in-gl.patch
+)
+
 pkg_pretend() {
        local CONFIG_CHECK="~IPC_NS ~PID_NS ~NET_NS ~UTS_NS"
 

Reply via email to