commit:     5062b137fe6cf107c6577d3d177e710bd0815554
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Fri Feb 14 14:12:08 2025 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Sat Feb 22 09:38:22 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5062b137

sys-boot/grub: Port to ver_replacing

Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>

 sys-boot/grub/grub-2.12-r5.ebuild | 24 +++++++++---------------
 sys-boot/grub/grub-9999.ebuild    | 24 +++++++++---------------
 2 files changed, 18 insertions(+), 30 deletions(-)

diff --git a/sys-boot/grub/grub-2.12-r5.ebuild 
b/sys-boot/grub/grub-2.12-r5.ebuild
index 2328a488d4ec..1ce846322f6f 100644
--- a/sys-boot/grub/grub-2.12-r5.ebuild
+++ b/sys-boot/grub/grub-2.12-r5.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2024 Gentoo Authors
+# Copyright 1999-2025 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
@@ -25,8 +25,8 @@ if [[ -n ${GRUB_AUTORECONF} ]]; then
        inherit autotools
 fi
 
-inherit bash-completion-r1 flag-o-matic multibuild optfeature python-any-r1
-inherit secureboot toolchain-funcs
+inherit bash-completion-r1 eapi9-ver flag-o-matic multibuild optfeature
+inherit python-any-r1 secureboot toolchain-funcs
 
 DESCRIPTION="GNU GRUB boot loader"
 HOMEPAGE="https://www.gnu.org/software/grub/";
@@ -387,23 +387,17 @@ pkg_postinst() {
        elog "For information on how to configure GRUB2 please refer to the 
guide:"
        elog "    https://wiki.gentoo.org/wiki/GRUB2_Quick_Start";
 
-       if [[ -n ${REPLACING_VERSIONS} ]]; then
-               local v
-               for v in ${REPLACING_VERSIONS}; do
-                       if ver_test -gt ${v}; then
-                               ewarn
-                               ewarn "Re-run grub-install to update installed 
boot code!"
-                               ewarn "Re-run grub-mkconfig to update grub.cfg!"
-                               ewarn
-                               break
-                       fi
-               done
-       else
+       if [[ -z ${REPLACING_VERSIONS} ]]; then
                elog
                optfeature "detecting other operating systems (grub-mkconfig)" 
sys-boot/os-prober
                optfeature "creating rescue media (grub-mkrescue)" 
dev-libs/libisoburn sys-fs/mtools
                optfeature "enabling RAID device detection" sys-fs/mdadm
                optfeature "automatically updating GRUB's configuration on each 
kernel installation" "sys-kernel/installkernel[grub]"
+       elif ver_replacing -lt ${PVR}; then
+               ewarn
+               ewarn "Re-run grub-install to update installed boot code!"
+               ewarn "Re-run grub-mkconfig to update grub.cfg!"
+               ewarn
        fi
 
        if has_version 'sys-boot/grub:0'; then

diff --git a/sys-boot/grub/grub-9999.ebuild b/sys-boot/grub/grub-9999.ebuild
index a1ef3c91a73f..52fa6f5a5449 100644
--- a/sys-boot/grub/grub-9999.ebuild
+++ b/sys-boot/grub/grub-9999.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2024 Gentoo Authors
+# Copyright 1999-2025 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
@@ -29,8 +29,8 @@ if [[ -n ${GRUB_AUTORECONF} ]]; then
        inherit autotools
 fi
 
-inherit bash-completion-r1 flag-o-matic multibuild optfeature python-any-r1
-inherit secureboot toolchain-funcs
+inherit bash-completion-r1 eapi9-ver flag-o-matic multibuild optfeature
+inherit python-any-r1 secureboot toolchain-funcs
 
 DESCRIPTION="GNU GRUB boot loader"
 HOMEPAGE="https://www.gnu.org/software/grub/";
@@ -384,23 +384,17 @@ pkg_postinst() {
        elog "For information on how to configure GRUB2 please refer to the 
guide:"
        elog "    https://wiki.gentoo.org/wiki/GRUB2_Quick_Start";
 
-       if [[ -n ${REPLACING_VERSIONS} ]]; then
-               local v
-               for v in ${REPLACING_VERSIONS}; do
-                       if ver_test -gt ${v}; then
-                               ewarn
-                               ewarn "Re-run grub-install to update installed 
boot code!"
-                               ewarn "Re-run grub-mkconfig to update grub.cfg!"
-                               ewarn
-                               break
-                       fi
-               done
-       else
+       if [[ -z ${REPLACING_VERSIONS} ]]; then
                elog
                optfeature "detecting other operating systems (grub-mkconfig)" 
sys-boot/os-prober
                optfeature "creating rescue media (grub-mkrescue)" 
dev-libs/libisoburn sys-fs/mtools
                optfeature "enabling RAID device detection" sys-fs/mdadm
                optfeature "automatically updating GRUB's configuration on each 
kernel installation" "sys-kernel/installkernel[grub]"
+       elif ver_replacing -lt ${PVR}; then
+               ewarn
+               ewarn "Re-run grub-install to update installed boot code!"
+               ewarn "Re-run grub-mkconfig to update grub.cfg!"
+               ewarn
        fi
 
        if has_version 'sys-boot/grub:0'; then

Reply via email to