summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2022-02-07 02:20:12 +0000
committerSam James <sam@gentoo.org>2022-02-07 02:21:17 +0000
commitd18f8f70b9d8d712a7a71b78091b407a9dd5bb92 (patch)
tree50a93e25456a26c4cd0ab3f02126cac3aa6c6b03 /sys-apps
parentsys-apps/man-db: add 2.10.0 (diff)
downloadgentoo-d18f8f70b9d8d712a7a71b78091b407a9dd5bb92.tar.gz
gentoo-d18f8f70b9d8d712a7a71b78091b407a9dd5bb92.tar.bz2
gentoo-d18f8f70b9d8d712a7a71b78091b407a9dd5bb92.zip
sys-apps/man-db: fix use of REPLACING_VERSIONS
Closes: https://bugs.gentoo.org/589514 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'sys-apps')
-rw-r--r--sys-apps/man-db/man-db-2.10.0.ebuild19
-rw-r--r--sys-apps/man-db/man-db-9999.ebuild19
2 files changed, 28 insertions, 10 deletions
diff --git a/sys-apps/man-db/man-db-2.10.0.ebuild b/sys-apps/man-db/man-db-2.10.0.ebuild
index 6948c20167a5..f49d58338bd1 100644
--- a/sys-apps/man-db/man-db-2.10.0.ebuild
+++ b/sys-apps/man-db/man-db-2.10.0.ebuild
@@ -163,8 +163,8 @@ pkg_preinst() {
# see bug #602588 comment 18
local _replacing_version=
local _setgid_vuln=0
- for _replacing_version in ${REPLACING_VERSIONS}; do
- if ver_test '2.7.6.1-r2' -le "${_replacing_version}"; then
+ for _replacing_version in ${REPLACING_VERSIONS} ; do
+ if ver_test '2.7.6.1-r2' -le "${_replacing_version}" ; then
debug-print "Skipping security bug #602588 ... existing installation (${_replacing_version}) should not be affected!"
else
_setgid_vuln=1
@@ -189,8 +189,17 @@ pkg_preinst() {
pkg_postinst() {
tmpfiles_process man-db.conf
- if [[ $(ver_cut 2 ${REPLACING_VERSIONS}) -lt 7 ]] ; then
- einfo "Rebuilding man-db from scratch with new database format!"
- su man -s /bin/sh -c 'mandb --quiet --create' 2>/dev/null
+ if [[ -n "${REPLACING_VERSIONS}" ]] ; then
+ local _replacing_version=
+
+ for _replacing_version in ${REPLACING_VERSIONS} ; do
+ if [[ $(ver_cut 2 ${_replacing_version}) -lt 7 ]] ; then
+ einfo "Rebuilding man-db from scratch with new database format!"
+ su man -s /bin/sh -c 'mandb --quiet --create' 2>/dev/null
+
+ # No need to run it again if we hit one
+ break
+ fi
+ done
fi
}
diff --git a/sys-apps/man-db/man-db-9999.ebuild b/sys-apps/man-db/man-db-9999.ebuild
index c0406d043a09..0c5780d1e7bf 100644
--- a/sys-apps/man-db/man-db-9999.ebuild
+++ b/sys-apps/man-db/man-db-9999.ebuild
@@ -161,8 +161,8 @@ pkg_preinst() {
# see bug #602588 comment 18
local _replacing_version=
local _setgid_vuln=0
- for _replacing_version in ${REPLACING_VERSIONS}; do
- if ver_test '2.7.6.1-r2' -le "${_replacing_version}"; then
+ for _replacing_version in ${REPLACING_VERSIONS} ; do
+ if ver_test '2.7.6.1-r2' -le "${_replacing_version}" ; then
debug-print "Skipping security bug #602588 ... existing installation (${_replacing_version}) should not be affected!"
else
_setgid_vuln=1
@@ -187,8 +187,17 @@ pkg_preinst() {
pkg_postinst() {
tmpfiles_process man-db.conf
- if [[ $(ver_cut 2 ${REPLACING_VERSIONS}) -lt 7 ]] ; then
- einfo "Rebuilding man-db from scratch with new database format!"
- su man -s /bin/sh -c 'mandb --quiet --create' 2>/dev/null
+ if [[ -n "${REPLACING_VERSIONS}" ]] ; then
+ local _replacing_version=
+
+ for _replacing_version in ${REPLACING_VERSIONS} ; do
+ if [[ $(ver_cut 2 ${_replacing_version}) -lt 7 ]] ; then
+ einfo "Rebuilding man-db from scratch with new database format!"
+ su man -s /bin/sh -c 'mandb --quiet --create' 2>/dev/null
+
+ # No need to run it again if we hit one
+ break
+ fi
+ done
fi
}