commit:     546650c382145559cb3e3d145010a7e856a5e5f1
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 24 12:36:13 2020 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Mon Aug 24 12:36:41 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=546650c3

sys-fs/lvm2: show some ewarns in pkg_postinst only once

Package-Manager: Portage-3.0.4, Repoman-3.0.1
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>

 sys-fs/lvm2/lvm2-2.02.187-r2.ebuild | 13 ++++++++-----
 sys-fs/lvm2/lvm2-2.03.10.ebuild     | 10 ++++++++--
 2 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/sys-fs/lvm2/lvm2-2.02.187-r2.ebuild 
b/sys-fs/lvm2/lvm2-2.02.187-r2.ebuild
index 3111a305fc4..2bc6f354e53 100644
--- a/sys-fs/lvm2/lvm2-2.02.187-r2.ebuild
+++ b/sys-fs/lvm2/lvm2-2.02.187-r2.ebuild
@@ -266,11 +266,14 @@ src_install() {
 }
 
 pkg_postinst() {
-       ewarn "Make sure the \"lvm\" init script is in the runlevels:"
-       ewarn "# rc-update add lvm boot"
-       ewarn
-       ewarn "Make sure to enable lvmetad in /etc/lvm/lvm.conf if you want"
-       ewarn "to enable lvm autoactivation and metadata caching."
+       if [[ -z "${REPLACING_VERSIONS}" ]]; then
+               # This is a new installation
+               ewarn "Make sure the \"lvm\" init script is in the runlevels:"
+               ewarn "# rc-update add lvm boot"
+               ewarn
+               ewarn "Make sure to enable lvmetad in /etc/lvm/lvm.conf if you 
want"
+               ewarn "to enable lvm autoactivation and metadata caching."
+       fi
 
        if use udev && [[ -d /run ]] ; then
                local permission_run_expected="drwxr-xr-x"

diff --git a/sys-fs/lvm2/lvm2-2.03.10.ebuild b/sys-fs/lvm2/lvm2-2.03.10.ebuild
index 66bf4be80bc..c1a7dbc3b20 100644
--- a/sys-fs/lvm2/lvm2-2.03.10.ebuild
+++ b/sys-fs/lvm2/lvm2-2.03.10.ebuild
@@ -253,8 +253,14 @@ src_install() {
 }
 
 pkg_postinst() {
-       ewarn "Make sure the \"lvm\" init script is in the runlevels:"
-       ewarn "# rc-update add lvm boot"
+       if [[ -z "${REPLACING_VERSIONS}" ]]; then
+               # This is a new installation
+               ewarn "Make sure the \"lvm\" init script is in the runlevels:"
+               ewarn "# rc-update add lvm boot"
+               ewarn
+               ewarn "Make sure to enable lvmetad in /etc/lvm/lvm.conf if you 
want"
+               ewarn "to enable lvm autoactivation and metadata caching."
+       fi
 
        if use udev && [[ -d /run ]] ; then
                local permission_run_expected="drwxr-xr-x"

Reply via email to