From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1460106-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))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id 652ED158020
	for <garchives@archives.gentoo.org>; Thu, 24 Nov 2022 19:52:47 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 87BB6E0886;
	Thu, 24 Nov 2022 19:52:46 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4])
	(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 717C3E0886
	for <gentoo-commits@lists.gentoo.org>; Thu, 24 Nov 2022 19:52:46 +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 5AF60340F14
	for <gentoo-commits@lists.gentoo.org>; Thu, 24 Nov 2022 19:52:45 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id A4D17756
	for <gentoo-commits@lists.gentoo.org>; Thu, 24 Nov 2022 19:52:43 +0000 (UTC)
From: "Mike Gilbert" <floppym@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, "Mike Gilbert" <floppym@gentoo.org>
Message-ID: <1669319554.f2ce3c6afffc66326db15f564e8e2aac8778ad26.floppym@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-libs/libxcrypt/
X-VCS-Repository: repo/gentoo
X-VCS-Files: sys-libs/libxcrypt/libxcrypt-4.4.28-r1.ebuild sys-libs/libxcrypt/libxcrypt-4.4.28-r2.ebuild sys-libs/libxcrypt/libxcrypt-4.4.33.ebuild
X-VCS-Directories: sys-libs/libxcrypt/
X-VCS-Committer: floppym
X-VCS-Committer-Name: Mike Gilbert
X-VCS-Revision: f2ce3c6afffc66326db15f564e8e2aac8778ad26
X-VCS-Branch: master
Date: Thu, 24 Nov 2022 19:52:43 +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: 4cec4d31-2047-4a2e-aafb-67d08e096a12
X-Archives-Hash: 14f56a29696394c83865a38b322e54fd

commit:     f2ce3c6afffc66326db15f564e8e2aac8778ad26
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Thu Nov 24 19:46:40 2022 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Thu Nov 24 19:52:34 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f2ce3c6a

sys-libs/libxcrypt: rework broken symlink detection

Use the GNU-specific find -xtype option; PMS says GNU find is required.
Ensure arguments are properlty quoted.
Consolidate output to one line per broken link.

Closes: https://bugs.gentoo.org/882801
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 sys-libs/libxcrypt/libxcrypt-4.4.28-r1.ebuild | 20 ++++++++++----------
 sys-libs/libxcrypt/libxcrypt-4.4.28-r2.ebuild | 20 ++++++++++----------
 sys-libs/libxcrypt/libxcrypt-4.4.33.ebuild    | 20 ++++++++++----------
 3 files changed, 30 insertions(+), 30 deletions(-)

diff --git a/sys-libs/libxcrypt/libxcrypt-4.4.28-r1.ebuild b/sys-libs/libxcrypt/libxcrypt-4.4.28-r1.ebuild
index 8f335d8027ca..581dc70c0fd7 100644
--- a/sys-libs/libxcrypt/libxcrypt-4.4.28-r1.ebuild
+++ b/sys-libs/libxcrypt/libxcrypt-4.4.28-r1.ebuild
@@ -304,17 +304,17 @@ pkg_preinst() {
 	# is cleaned up in *_src_install.
 	local broken_symlinks=()
 	mapfile -d '' broken_symlinks < <(
-		find "${ED}" -type l ! -exec test -e {} \; -print0 2>/dev/null
+		find "${ED}" -xtype l -print0
 	)
 
-	[[ -z "${broken_symlinks[@]}" ]] && return
-
-	eerror "Broken symlinks found before merging!"
-	for symlink in "${broken_symlinks[@]}" ; do
-		bad_dest="$(readlink -f ${symlink})"
-		eerror "\t${symlink} is broken!"
-		eerror "\treadlink -f ${symlink}:"
-		eerror "\t\t${bad_dest}"
+	if [[ ${#broken_symlinks[@]} -gt 0 ]]; then
+		eerror "Broken symlinks found before merging!"
+		local symlink target resolved
+		for symlink in "${broken_symlinks[@]}" ; do
+			target="$(readlink "${symlink}")"
+			resolved="$(readlink -f "${symlink}")"
+			eerror "  '${symlink}' -> '${target}' (${resolved})"
+		done
 		die "Broken symlinks found! Aborting to avoid damaging system. Please report a bug."
-	done
+	fi
 }

diff --git a/sys-libs/libxcrypt/libxcrypt-4.4.28-r2.ebuild b/sys-libs/libxcrypt/libxcrypt-4.4.28-r2.ebuild
index 5e72a74c6d85..755fdd744e22 100644
--- a/sys-libs/libxcrypt/libxcrypt-4.4.28-r2.ebuild
+++ b/sys-libs/libxcrypt/libxcrypt-4.4.28-r2.ebuild
@@ -320,17 +320,17 @@ pkg_preinst() {
 	# is cleaned up in *_src_install.
 	local broken_symlinks=()
 	mapfile -d '' broken_symlinks < <(
-		find "${ED}" -type l ! -exec test -e {} \; -print0 2>/dev/null
+		find "${ED}" -xtype l -print0
 	)
 
-	[[ -z "${broken_symlinks[@]}" ]] && return
-
-	eerror "Broken symlinks found before merging!"
-	for symlink in "${broken_symlinks[@]}" ; do
-		bad_dest="$(readlink -f ${symlink})"
-		eerror "\t${symlink} is broken!"
-		eerror "\treadlink -f ${symlink}:"
-		eerror "\t\t${bad_dest}"
+	if [[ ${#broken_symlinks[@]} -gt 0 ]]; then
+		eerror "Broken symlinks found before merging!"
+		local symlink target resolved
+		for symlink in "${broken_symlinks[@]}" ; do
+			target="$(readlink "${symlink}")"
+			resolved="$(readlink -f "${symlink}")"
+			eerror "  '${symlink}' -> '${target}' (${resolved})"
+		done
 		die "Broken symlinks found! Aborting to avoid damaging system. Please report a bug."
-	done
+	fi
 }

diff --git a/sys-libs/libxcrypt/libxcrypt-4.4.33.ebuild b/sys-libs/libxcrypt/libxcrypt-4.4.33.ebuild
index d0bd8a723065..0e077bd372ed 100644
--- a/sys-libs/libxcrypt/libxcrypt-4.4.33.ebuild
+++ b/sys-libs/libxcrypt/libxcrypt-4.4.33.ebuild
@@ -315,17 +315,17 @@ pkg_preinst() {
 	# is cleaned up in *_src_install.
 	local broken_symlinks=()
 	mapfile -d '' broken_symlinks < <(
-		find "${ED}" -type l ! -exec test -e {} \; -print0 2>/dev/null
+		find "${ED}" -xtype l -print0
 	)
 
-	[[ -z "${broken_symlinks[@]}" ]] && return
-
-	eerror "Broken symlinks found before merging!"
-	for symlink in "${broken_symlinks[@]}" ; do
-		bad_dest="$(readlink -f ${symlink})"
-		eerror "\t${symlink} is broken!"
-		eerror "\treadlink -f ${symlink}:"
-		eerror "\t\t${bad_dest}"
+	if [[ ${#broken_symlinks[@]} -gt 0 ]]; then
+		eerror "Broken symlinks found before merging!"
+		local symlink target resolved
+		for symlink in "${broken_symlinks[@]}" ; do
+			target="$(readlink "${symlink}")"
+			resolved="$(readlink -f "${symlink}")"
+			eerror "  '${symlink}' -> '${target}' (${resolved})"
+		done
 		die "Broken symlinks found! Aborting to avoid damaging system. Please report a bug."
-	done
+	fi
 }