commit:     c6d321c915a0986da8c616536d1d0fce90013b57
Author:     Florian Schmaus <flow <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 28 14:49:05 2023 +0000
Commit:     Florian Schmaus <flow <AT> gentoo <DOT> org>
CommitDate: Wed Mar  1 08:18:27 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c6d321c9

app-text/texlive-core: only ewarn on upgrade

Signed-off-by: Florian Schmaus <flow <AT> gentoo.org>

 app-text/texlive-core/texlive-core-2021-r6.ebuild | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/app-text/texlive-core/texlive-core-2021-r6.ebuild 
b/app-text/texlive-core/texlive-core-2021-r6.ebuild
index 0b463ff9a7ff..6ef89fc8bfd5 100644
--- a/app-text/texlive-core/texlive-core-2021-r6.ebuild
+++ b/app-text/texlive-core/texlive-core-2021-r6.ebuild
@@ -363,6 +363,24 @@ pkg_postinst() {
        elog "If you have configuration files in ${EPREFIX}/etc/texmf to merge,"
        elog "please update them and run ${EPREFIX}/usr/sbin/texmf-update."
        elog
+
+       local display_migration_hint=false
+       if [[ -n ${REPLACING_VERSIONS} ]]; then
+               local new_texlive_ver=$(ver_cut 1)
+               local replaced_version
+               for replaced_version in ${REPLACING_VERSIONS}; do
+                       replaced_version=$(ver_cut 1 ${replaced_version})
+                       if (( replaced_version < new_texlive_version )); then
+                               display_migration_hint=true
+                               break
+                       fi
+               done
+       fi
+
+       if ! ${display_migration_hint}; then
+               return
+       fi
+
        ewarn "If you are migrating from an older TeX distribution"
        ewarn "Please make sure you have read:"
        ewarn 
"https://wiki.gentoo.org/wiki/Project:TeX/Tex_Live_Migration_Guide";

Reply via email to