Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/man-db/
Date: Mon, 07 Feb 2022 02:27:16
Message-Id: 1644200477.d18f8f70b9d8d712a7a71b78091b407a9dd5bb92.sam@gentoo
1 commit: d18f8f70b9d8d712a7a71b78091b407a9dd5bb92
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Mon Feb 7 02:20:12 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Mon Feb 7 02:21:17 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d18f8f70
7
8 sys-apps/man-db: fix use of REPLACING_VERSIONS
9
10 Closes: https://bugs.gentoo.org/589514
11 Signed-off-by: Sam James <sam <AT> gentoo.org>
12
13 sys-apps/man-db/man-db-2.10.0.ebuild | 19 ++++++++++++++-----
14 sys-apps/man-db/man-db-9999.ebuild | 19 ++++++++++++++-----
15 2 files changed, 28 insertions(+), 10 deletions(-)
16
17 diff --git a/sys-apps/man-db/man-db-2.10.0.ebuild b/sys-apps/man-db/man-db-2.10.0.ebuild
18 index 6948c20167a5..f49d58338bd1 100644
19 --- a/sys-apps/man-db/man-db-2.10.0.ebuild
20 +++ b/sys-apps/man-db/man-db-2.10.0.ebuild
21 @@ -163,8 +163,8 @@ pkg_preinst() {
22 # see bug #602588 comment 18
23 local _replacing_version=
24 local _setgid_vuln=0
25 - for _replacing_version in ${REPLACING_VERSIONS}; do
26 - if ver_test '2.7.6.1-r2' -le "${_replacing_version}"; then
27 + for _replacing_version in ${REPLACING_VERSIONS} ; do
28 + if ver_test '2.7.6.1-r2' -le "${_replacing_version}" ; then
29 debug-print "Skipping security bug #602588 ... existing installation (${_replacing_version}) should not be affected!"
30 else
31 _setgid_vuln=1
32 @@ -189,8 +189,17 @@ pkg_preinst() {
33 pkg_postinst() {
34 tmpfiles_process man-db.conf
35
36 - if [[ $(ver_cut 2 ${REPLACING_VERSIONS}) -lt 7 ]] ; then
37 - einfo "Rebuilding man-db from scratch with new database format!"
38 - su man -s /bin/sh -c 'mandb --quiet --create' 2>/dev/null
39 + if [[ -n "${REPLACING_VERSIONS}" ]] ; then
40 + local _replacing_version=
41 +
42 + for _replacing_version in ${REPLACING_VERSIONS} ; do
43 + if [[ $(ver_cut 2 ${_replacing_version}) -lt 7 ]] ; then
44 + einfo "Rebuilding man-db from scratch with new database format!"
45 + su man -s /bin/sh -c 'mandb --quiet --create' 2>/dev/null
46 +
47 + # No need to run it again if we hit one
48 + break
49 + fi
50 + done
51 fi
52 }
53
54 diff --git a/sys-apps/man-db/man-db-9999.ebuild b/sys-apps/man-db/man-db-9999.ebuild
55 index c0406d043a09..0c5780d1e7bf 100644
56 --- a/sys-apps/man-db/man-db-9999.ebuild
57 +++ b/sys-apps/man-db/man-db-9999.ebuild
58 @@ -161,8 +161,8 @@ pkg_preinst() {
59 # see bug #602588 comment 18
60 local _replacing_version=
61 local _setgid_vuln=0
62 - for _replacing_version in ${REPLACING_VERSIONS}; do
63 - if ver_test '2.7.6.1-r2' -le "${_replacing_version}"; then
64 + for _replacing_version in ${REPLACING_VERSIONS} ; do
65 + if ver_test '2.7.6.1-r2' -le "${_replacing_version}" ; then
66 debug-print "Skipping security bug #602588 ... existing installation (${_replacing_version}) should not be affected!"
67 else
68 _setgid_vuln=1
69 @@ -187,8 +187,17 @@ pkg_preinst() {
70 pkg_postinst() {
71 tmpfiles_process man-db.conf
72
73 - if [[ $(ver_cut 2 ${REPLACING_VERSIONS}) -lt 7 ]] ; then
74 - einfo "Rebuilding man-db from scratch with new database format!"
75 - su man -s /bin/sh -c 'mandb --quiet --create' 2>/dev/null
76 + if [[ -n "${REPLACING_VERSIONS}" ]] ; then
77 + local _replacing_version=
78 +
79 + for _replacing_version in ${REPLACING_VERSIONS} ; do
80 + if [[ $(ver_cut 2 ${_replacing_version}) -lt 7 ]] ; then
81 + einfo "Rebuilding man-db from scratch with new database format!"
82 + su man -s /bin/sh -c 'mandb --quiet --create' 2>/dev/null
83 +
84 + # No need to run it again if we hit one
85 + break
86 + fi
87 + done
88 fi
89 }