From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1347438-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id BC25C158086
	for <garchives@archives.gentoo.org>; Thu,  9 Dec 2021 06:37:40 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 97E5A2BC007;
	Thu,  9 Dec 2021 06:37:38 +0000 (UTC)
Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id B32982BC007
	for <gentoo-commits@lists.gentoo.org>; Thu,  9 Dec 2021 06:37:37 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 335D33433E0
	for <gentoo-commits@lists.gentoo.org>; Thu,  9 Dec 2021 06:37:36 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 6266A206
	for <gentoo-commits@lists.gentoo.org>; Thu,  9 Dec 2021 06:37:34 +0000 (UTC)
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" <sam@gentoo.org>
Message-ID: <1639029450.1aa54cb91cfc6da9f151abaa49f045ea291189f4.sam@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-libs/glibc/
X-VCS-Repository: repo/gentoo
X-VCS-Files: sys-libs/glibc/glibc-2.34-r3.ebuild sys-libs/glibc/glibc-9999.ebuild
X-VCS-Directories: sys-libs/glibc/
X-VCS-Committer: sam
X-VCS-Committer-Name: Sam James
X-VCS-Revision: 1aa54cb91cfc6da9f151abaa49f045ea291189f4
X-VCS-Branch: master
Date: Thu,  9 Dec 2021 06:37:34 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: 98f219ab-3708-43aa-8527-8991a337de76
X-Archives-Hash: 6e97e80043250f4685ddef13f267194b

commit:     1aa54cb91cfc6da9f151abaa49f045ea291189f4
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Dec  9 05:57:30 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Dec  9 05:57:30 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1aa54cb9

sys-libs/glibc: re-sync 2.34-r3/9999 for warning-on-upgrade

Signed-off-by: Sam James <sam <AT> gentoo.org>

 sys-libs/glibc/glibc-2.34-r3.ebuild | 21 ++++++++++++++++-----
 sys-libs/glibc/glibc-9999.ebuild    | 21 ++++++++++++++++-----
 2 files changed, 32 insertions(+), 10 deletions(-)

diff --git a/sys-libs/glibc/glibc-2.34-r3.ebuild b/sys-libs/glibc/glibc-2.34-r3.ebuild
index 7053b85282f1..b65194c38f6f 100644
--- a/sys-libs/glibc/glibc-2.34-r3.ebuild
+++ b/sys-libs/glibc/glibc-2.34-r3.ebuild
@@ -730,6 +730,20 @@ sanity_prechecks() {
 	fi
 }
 
+upgrade_warning() {
+	if [[ ${MERGE_TYPE} != buildonly && -n ${REPLACING_VERSIONS} && -z ${ROOT} ]]; then
+		local oldv newv=$(ver_cut 1-2 ${PV})
+		for oldv in ${REPLACING_VERSIONS}; do
+			if ver_test ${oldv} -lt ${newv}; then
+				ewarn "After upgrading glibc, please restart all running processes."
+				ewarn "Be sure to include init (telinit u) or systemd (systemctl daemon-reexec)."
+				ewarn "Alternatively, reboot your system."
+				break
+			fi
+		done
+	fi
+}
+
 #
 # the phases
 #
@@ -740,6 +754,7 @@ pkg_pretend() {
 	# All the checks...
 	einfo "Checking general environment sanity."
 	sanity_prechecks
+	upgrade_warning
 }
 
 pkg_setup() {
@@ -1558,11 +1573,7 @@ pkg_postinst() {
 		use compile-locales || run_locale_gen "${EROOT}/"
 	fi
 
-	if systemd_is_booted && [[ -z ${ROOT} ]] ; then
-		# We need to restart systemd when upgrading from < 2.34
-		# bug #823756
-		systemctl daemon-reexec
-	fi
+	upgrade_warning
 
 	# Check for sanity of /etc/nsswitch.conf, take 2
 	if [[ -e ${EROOT}/etc/nsswitch.conf ]] && ! has_version sys-auth/libnss-nis ; then

diff --git a/sys-libs/glibc/glibc-9999.ebuild b/sys-libs/glibc/glibc-9999.ebuild
index ea87ec9994c8..22f47562ff94 100644
--- a/sys-libs/glibc/glibc-9999.ebuild
+++ b/sys-libs/glibc/glibc-9999.ebuild
@@ -813,6 +813,20 @@ sanity_prechecks() {
 	fi
 }
 
+upgrade_warning() {
+	if [[ ${MERGE_TYPE} != buildonly && -n ${REPLACING_VERSIONS} && -z ${ROOT} ]]; then
+		local oldv newv=$(ver_cut 1-2 ${PV})
+		for oldv in ${REPLACING_VERSIONS}; do
+			if ver_test ${oldv} -lt ${newv}; then
+				ewarn "After upgrading glibc, please restart all running processes."
+				ewarn "Be sure to include init (telinit u) or systemd (systemctl daemon-reexec)."
+				ewarn "Alternatively, reboot your system."
+				break
+			fi
+		done
+	fi
+}
+
 #
 # the phases
 #
@@ -823,6 +837,7 @@ pkg_pretend() {
 	# All the checks...
 	einfo "Checking general environment sanity."
 	sanity_prechecks
+	upgrade_warning
 }
 
 pkg_setup() {
@@ -1590,11 +1605,7 @@ pkg_postinst() {
 		use compile-locales || run_locale_gen "${EROOT}/"
 	fi
 
-	if systemd_is_booted && [[ -z ${ROOT} ]] ; then
-		# We need to restart systemd when upgrading from < 2.34
-		# bug #823756
-		systemctl daemon-reexec
-	fi
+	upgrade_warning
 
 	# Check for sanity of /etc/nsswitch.conf, take 2
 	if [[ -e ${EROOT}/etc/nsswitch.conf ]] && ! has_version sys-auth/libnss-nis ; then