diff options
author | 2024-04-04 10:39:22 +0200 | |
---|---|---|
committer | 2024-04-04 10:39:22 +0200 | |
commit | 1f7c05bcf94ecaec88e1bcccea022bd2e15106c9 (patch) | |
tree | 181385ab64c0d8a553443c38c424c6023b0b90a5 | |
parent | texlive-module.eclass: shorten ebegin message (diff) | |
download | tex-overlay-1f7c05bcf94ecaec88e1bcccea022bd2e15106c9.tar.gz tex-overlay-1f7c05bcf94ecaec88e1bcccea022bd2e15106c9.tar.bz2 tex-overlay-1f7c05bcf94ecaec88e1bcccea022bd2e15106c9.zip |
eclass: sync eclasses with ::gentoo
Signed-off-by: Florian Schmaus <flow@gentoo.org>
-rw-r--r-- | eclass/texlive-common.eclass | 57 | ||||
-rw-r--r-- | eclass/texlive-module.eclass | 59 |
2 files changed, 58 insertions, 58 deletions
diff --git a/eclass/texlive-common.eclass b/eclass/texlive-common.eclass index 1e5c8a5..66d3999 100644 --- a/eclass/texlive-common.eclass +++ b/eclass/texlive-common.eclass @@ -179,7 +179,8 @@ etexmf-update() { if [[ -z ${ROOT} && -x "${EPREFIX}"/usr/sbin/texmf-update ]] ; then "${EPREFIX}"/usr/sbin/texmf-update local res="${?}" - if [[ "${res}" -ne 0 ]] && ver_test -ge 2023; then + if [[ "${res}" -ne 0 ]] && + { [[ ${CATEGORY} != dev-texlive ]] || ver_test -ge 2023; } then die -n "texmf-update returned non-zero exit status ${res}" fi else @@ -248,4 +249,58 @@ texlive-common_append_to_src_uri() { fi } +# @FUNCTION: texlive-common_update_tlpdb +# @DESCRIPTION: +# Update the TexLive package database at /usr/share/tlpkg/texlive.tlpdb. +texlive-common_update_tlpdb() { + [[ -v TL_PV && ${TL_PV} -lt 2023 ]] && return + + # If we are updating this package, then there is no need to update + # the tlpdb in postrm, as it will be again updated in postinst. + [[ ${EBUILD_PHASE} == postrm && -n ${REPLACED_BY_VERSION} ]] && return + + local tlpkg="${EROOT}"/usr/share/tlpkg + local tlpobj="${tlpkg}"/tlpobj + local tlpdb="${tlpkg}"/texlive.tlpdb + + ebegin "Regenerating TexLive package database" + + local new_tlpdb="${T}"/texlive.tlpdb + + touch "${new_tlpdb}" || die + + find "${tlpobj}" -maxdepth 1 -type f -name "*.tlpobj" -print0 | + sort -z | + xargs -0 --no-run-if-empty cat >> "${new_tlpdb}" + assert "generating tlpdb failed" + + if [[ -f ${tlpdb} ]]; then + cmp -s "${new_tlpdb}" "${tlpdb}" + local ret=$? + case ${ret} in + # content equal + 0) + # Nothing to do, return. + eend 0 + return + ;; + # content differs + 1) + ;; + # cmp failed with an error + *) + eend ${ret} "comparing new and existing tlpdb failed (exit status: ${ret})" + die + ;; + esac + fi + + mv "${new_tlpdb}" "${tlpdb}" + eend $? "moving tlpdb into position failed (exit status: ${?})" || die + + if [[ ! -s ${tlpdb} ]]; then + rm "${tlpdb}" || die + fi +} + fi diff --git a/eclass/texlive-module.eclass b/eclass/texlive-module.eclass index bfe5e12..401b75b 100644 --- a/eclass/texlive-module.eclass +++ b/eclass/texlive-module.eclass @@ -420,61 +420,6 @@ texlive-module_src_install() { texlive-common_handle_config_files } -# @FUNCTION: texlive-module_update_tlpdb -# @DESCRIPTION: -# Update the TexLive package database at /usr/share/tlpkg/texlive.tlpdb. - -texlive-module_update_tlpdb() { - [[ ${TL_PV} -lt 2023 ]] && return - - # If we are updating this package, then there is no need to update - # the tlpdb in postrm, as it will be again updated in postinst. - [[ ${EBUILD_PHASE} == postrm && -n ${REPLACED_BY_VERSION} ]] && return - - local tlpkg="${EROOT}"/usr/share/tlpkg - local tlpobj="${tlpkg}"/tlpobj - local tlpdb="${tlpkg}"/texlive.tlpdb - - ebegin "Regenerating TexLive package database" - - local new_tlpdb="${T}"/texlive.tlpdb - - touch "${new_tlpdb}" || die - - find "${tlpobj}" -maxdepth 1 -type f -name "*.tlpobj" -print0 | - sort -z | - xargs -0 --no-run-if-empty cat >> "${new_tlpdb}" - assert "generating tlpdb failed" - - if [[ -f ${tlpdb} ]]; then - cmp -s "${new_tlpdb}" "${tlpdb}" - local ret=$? - case ${ret} in - # content equal - 0) - # Nothing to do, return. - eend 0 - return - ;; - # content differs - 1) - ;; - # cmp failed with an error - *) - eend ${ret} "comparing new and existing tlpdb failed (exit status: ${ret})" - die - ;; - esac - fi - - mv "${new_tlpdb}" "${tlpdb}" - eend $? "moving tlpdb into position failed (exit status: ${?})" || die - - if [[ ! -s ${tlpdb} ]]; then - rm "${tlpdb}" || die - fi -} - # @FUNCTION: texlive-module_pkg_postinst # @DESCRIPTION: # exported function: @@ -483,7 +428,7 @@ texlive-module_update_tlpdb() { texlive-module_pkg_postinst() { etexmf-update - texlive-module_update_tlpdb + texlive-common_update_tlpdb [[ -n ${TL_MODULE_INFORMATION} ]] && elog "${TL_MODULE_INFORMATION}" } @@ -495,7 +440,7 @@ texlive-module_pkg_postinst() { texlive-module_pkg_postrm() { [[ -z ${REPLACED_BY_VERSION} ]] && etexmf-update - texlive-module_update_tlpdb + texlive-common_update_tlpdb } fi |