commit:     7dcfe0e62eff4099d8d00ec749a6eb3796305172
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Fri Feb 14 14:11:51 2025 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Sat Feb 22 09:38:19 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7dcfe0e6

net-print/cups: Port to ver_replacing

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

 net-print/cups/cups-2.4.11.ebuild | 25 ++++++++++---------------
 net-print/cups/cups-9999.ebuild   | 25 ++++++++++---------------
 2 files changed, 20 insertions(+), 30 deletions(-)

diff --git a/net-print/cups/cups-2.4.11.ebuild 
b/net-print/cups/cups-2.4.11.ebuild
index 63e2c8ed09da..8c93c81f496e 100644
--- a/net-print/cups/cups-2.4.11.ebuild
+++ b/net-print/cups/cups-2.4.11.ebuild
@@ -1,9 +1,9 @@
-# Copyright 1999-2024 Gentoo Authors
+# Copyright 1999-2025 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
 
-inherit autotools linux-info xdg multilib-minimal optfeature pam 
toolchain-funcs
+inherit autotools eapi9-ver linux-info xdg multilib-minimal optfeature pam 
toolchain-funcs
 
 MY_PV="${PV/_beta/b}"
 MY_PV="${MY_PV/_rc/rc}"
@@ -297,23 +297,18 @@ multilib_src_install_all() {
 
 pkg_postinst() {
        xdg_pkg_postinst
-       local v
-
-       for v in ${REPLACING_VERSIONS}; do
-               if ! ver_test ${v} -ge 2.2.2-r2 ; then
-                       ewarn "The cupsd init script switched to using 
pidfiles. Shutting down"
-                       ewarn "cupsd will fail the next time. To fix this, 
please run once as root"
-                       ewarn "   killall cupsd ; /etc/init.d/cupsd zap ; 
/etc/init.d/cupsd start"
-                       break
-               fi
-       done
 
-       for v in ${REPLACING_VERSIONS}; do
+       if ver_replacing -lt 2.2.2-r2 ; then
+               ewarn "The cupsd init script switched to using pidfiles. 
Shutting down"
+               ewarn "cupsd will fail the next time. To fix this, please run 
once as root"
+               ewarn "   killall cupsd ; /etc/init.d/cupsd zap ; 
/etc/init.d/cupsd start"
+       fi
+
+       if [[ -n ${REPLACING_VERSIONS} ]]; then
                elog
                elog "For information about installing a printer and general 
cups setup"
                elog "take a look at: https://wiki.gentoo.org/wiki/Printing";
-               break
-       done
+       fi
 
        optfeature_header "CUPS may need installing the following for certain 
features to work:"
        use zeroconf && optfeature "local hostname resolution using a 
hostname.local naming scheme" sys-auth/nss-mdns

diff --git a/net-print/cups/cups-9999.ebuild b/net-print/cups/cups-9999.ebuild
index 4e72b3e88b7a..31c2ee4826f0 100644
--- a/net-print/cups/cups-9999.ebuild
+++ b/net-print/cups/cups-9999.ebuild
@@ -1,9 +1,9 @@
-# Copyright 1999-2024 Gentoo Authors
+# Copyright 1999-2025 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
 
-inherit autotools linux-info xdg multilib-minimal optfeature pam 
toolchain-funcs
+inherit autotools eapi9-ver linux-info xdg multilib-minimal optfeature pam 
toolchain-funcs
 
 MY_PV="${PV/_beta/b}"
 MY_PV="${MY_PV/_rc/rc}"
@@ -297,23 +297,18 @@ multilib_src_install_all() {
 
 pkg_postinst() {
        xdg_pkg_postinst
-       local v
-
-       for v in ${REPLACING_VERSIONS}; do
-               if ! ver_test ${v} -ge 2.2.2-r2 ; then
-                       ewarn "The cupsd init script switched to using 
pidfiles. Shutting down"
-                       ewarn "cupsd will fail the next time. To fix this, 
please run once as root"
-                       ewarn "   killall cupsd ; /etc/init.d/cupsd zap ; 
/etc/init.d/cupsd start"
-                       break
-               fi
-       done
 
-       for v in ${REPLACING_VERSIONS}; do
+       if ver_replacing -lt 2.2.2-r2 ; then
+               ewarn "The cupsd init script switched to using pidfiles. 
Shutting down"
+               ewarn "cupsd will fail the next time. To fix this, please run 
once as root"
+               ewarn "   killall cupsd ; /etc/init.d/cupsd zap ; 
/etc/init.d/cupsd start"
+       fi
+
+       if [[ -n ${REPLACING_VERSIONS} ]]; then
                elog
                elog "For information about installing a printer and general 
cups setup"
                elog "take a look at: https://wiki.gentoo.org/wiki/Printing";
-               break
-       done
+       fi
 
        optfeature_header "CUPS may need installing the following for certain 
features to work:"
        use zeroconf && optfeature "local hostname resolution using a 
hostname.local naming scheme" sys-auth/nss-mdns

Reply via email to