Gentoo Archives: gentoo-commits

From: Mike Gilbert <floppym@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-libs/libxcrypt/
Date: Thu, 24 Nov 2022 19:52:47
Message-Id: 1669319554.f2ce3c6afffc66326db15f564e8e2aac8778ad26.floppym@gentoo
1 commit: f2ce3c6afffc66326db15f564e8e2aac8778ad26
2 Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
3 AuthorDate: Thu Nov 24 19:46:40 2022 +0000
4 Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
5 CommitDate: Thu Nov 24 19:52:34 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f2ce3c6a
7
8 sys-libs/libxcrypt: rework broken symlink detection
9
10 Use the GNU-specific find -xtype option; PMS says GNU find is required.
11 Ensure arguments are properlty quoted.
12 Consolidate output to one line per broken link.
13
14 Closes: https://bugs.gentoo.org/882801
15 Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
16
17 sys-libs/libxcrypt/libxcrypt-4.4.28-r1.ebuild | 20 ++++++++++----------
18 sys-libs/libxcrypt/libxcrypt-4.4.28-r2.ebuild | 20 ++++++++++----------
19 sys-libs/libxcrypt/libxcrypt-4.4.33.ebuild | 20 ++++++++++----------
20 3 files changed, 30 insertions(+), 30 deletions(-)
21
22 diff --git a/sys-libs/libxcrypt/libxcrypt-4.4.28-r1.ebuild b/sys-libs/libxcrypt/libxcrypt-4.4.28-r1.ebuild
23 index 8f335d8027ca..581dc70c0fd7 100644
24 --- a/sys-libs/libxcrypt/libxcrypt-4.4.28-r1.ebuild
25 +++ b/sys-libs/libxcrypt/libxcrypt-4.4.28-r1.ebuild
26 @@ -304,17 +304,17 @@ pkg_preinst() {
27 # is cleaned up in *_src_install.
28 local broken_symlinks=()
29 mapfile -d '' broken_symlinks < <(
30 - find "${ED}" -type l ! -exec test -e {} \; -print0 2>/dev/null
31 + find "${ED}" -xtype l -print0
32 )
33
34 - [[ -z "${broken_symlinks[@]}" ]] && return
35 -
36 - eerror "Broken symlinks found before merging!"
37 - for symlink in "${broken_symlinks[@]}" ; do
38 - bad_dest="$(readlink -f ${symlink})"
39 - eerror "\t${symlink} is broken!"
40 - eerror "\treadlink -f ${symlink}:"
41 - eerror "\t\t${bad_dest}"
42 + if [[ ${#broken_symlinks[@]} -gt 0 ]]; then
43 + eerror "Broken symlinks found before merging!"
44 + local symlink target resolved
45 + for symlink in "${broken_symlinks[@]}" ; do
46 + target="$(readlink "${symlink}")"
47 + resolved="$(readlink -f "${symlink}")"
48 + eerror " '${symlink}' -> '${target}' (${resolved})"
49 + done
50 die "Broken symlinks found! Aborting to avoid damaging system. Please report a bug."
51 - done
52 + fi
53 }
54
55 diff --git a/sys-libs/libxcrypt/libxcrypt-4.4.28-r2.ebuild b/sys-libs/libxcrypt/libxcrypt-4.4.28-r2.ebuild
56 index 5e72a74c6d85..755fdd744e22 100644
57 --- a/sys-libs/libxcrypt/libxcrypt-4.4.28-r2.ebuild
58 +++ b/sys-libs/libxcrypt/libxcrypt-4.4.28-r2.ebuild
59 @@ -320,17 +320,17 @@ pkg_preinst() {
60 # is cleaned up in *_src_install.
61 local broken_symlinks=()
62 mapfile -d '' broken_symlinks < <(
63 - find "${ED}" -type l ! -exec test -e {} \; -print0 2>/dev/null
64 + find "${ED}" -xtype l -print0
65 )
66
67 - [[ -z "${broken_symlinks[@]}" ]] && return
68 -
69 - eerror "Broken symlinks found before merging!"
70 - for symlink in "${broken_symlinks[@]}" ; do
71 - bad_dest="$(readlink -f ${symlink})"
72 - eerror "\t${symlink} is broken!"
73 - eerror "\treadlink -f ${symlink}:"
74 - eerror "\t\t${bad_dest}"
75 + if [[ ${#broken_symlinks[@]} -gt 0 ]]; then
76 + eerror "Broken symlinks found before merging!"
77 + local symlink target resolved
78 + for symlink in "${broken_symlinks[@]}" ; do
79 + target="$(readlink "${symlink}")"
80 + resolved="$(readlink -f "${symlink}")"
81 + eerror " '${symlink}' -> '${target}' (${resolved})"
82 + done
83 die "Broken symlinks found! Aborting to avoid damaging system. Please report a bug."
84 - done
85 + fi
86 }
87
88 diff --git a/sys-libs/libxcrypt/libxcrypt-4.4.33.ebuild b/sys-libs/libxcrypt/libxcrypt-4.4.33.ebuild
89 index d0bd8a723065..0e077bd372ed 100644
90 --- a/sys-libs/libxcrypt/libxcrypt-4.4.33.ebuild
91 +++ b/sys-libs/libxcrypt/libxcrypt-4.4.33.ebuild
92 @@ -315,17 +315,17 @@ pkg_preinst() {
93 # is cleaned up in *_src_install.
94 local broken_symlinks=()
95 mapfile -d '' broken_symlinks < <(
96 - find "${ED}" -type l ! -exec test -e {} \; -print0 2>/dev/null
97 + find "${ED}" -xtype l -print0
98 )
99
100 - [[ -z "${broken_symlinks[@]}" ]] && return
101 -
102 - eerror "Broken symlinks found before merging!"
103 - for symlink in "${broken_symlinks[@]}" ; do
104 - bad_dest="$(readlink -f ${symlink})"
105 - eerror "\t${symlink} is broken!"
106 - eerror "\treadlink -f ${symlink}:"
107 - eerror "\t\t${bad_dest}"
108 + if [[ ${#broken_symlinks[@]} -gt 0 ]]; then
109 + eerror "Broken symlinks found before merging!"
110 + local symlink target resolved
111 + for symlink in "${broken_symlinks[@]}" ; do
112 + target="$(readlink "${symlink}")"
113 + resolved="$(readlink -f "${symlink}")"
114 + eerror " '${symlink}' -> '${target}' (${resolved})"
115 + done
116 die "Broken symlinks found! Aborting to avoid damaging system. Please report a bug."
117 - done
118 + fi
119 }