commit:     b831451172bd7855c915363be94339699eaec4ea
Author:     Eli Schwartz <eschwartz93 <AT> gmail <DOT> com>
AuthorDate: Mon Oct  2 06:55:48 2023 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Oct 18 04:26:00 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b8314511

app-text/calibre: Remove erroneous "binary install" workaround

This has never been caused by the upstream binary install, which
installs to /opt and does not affect from-source installs under any
circumstances ever.

What did happen is back during the major version update from 2.85 to
3.0, upstream stopped including a vendored regex/ module, and started
expecting it to be installed as a system dependency.

Under most circumstances, this was fine, and simply installing the
dependency would get things working. One possible edge case occurred,
however, when the old version of the package did NOT byte-compile the
vendored regex module, but calibre was run as root. (There are reasons
it might end up being run as root, the most obvious being that a user
wanted to run the headless server or another command-line tool.)

If this happened, then the python interpreter would automatically
byte-compile every module on import, but the PM wouldn't track it for
removal. After an upgrade, the cached file could still be imported and
would effectively mask the system version of the regex module, but would
be missing the binary portion.

Signed-off-by: Eli Schwartz <eschwartz93 <AT> gmail.com>
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 app-text/calibre/calibre-5.44.0-r2.ebuild | 16 ----------------
 1 file changed, 16 deletions(-)

diff --git a/app-text/calibre/calibre-5.44.0-r2.ebuild 
b/app-text/calibre/calibre-5.44.0-r2.ebuild
index e2db565d6f63..8ff7f95c90aa 100644
--- a/app-text/calibre/calibre-5.44.0-r2.ebuild
+++ b/app-text/calibre/calibre-5.44.0-r2.ebuild
@@ -253,23 +253,7 @@ src_install() {
        newconfd "${FILESDIR}"/calibre-server-3.conf calibre-server
 }
 
-pkg_preinst() {
-       # Indentify stray directories from upstream's "Binary install"
-       # method (see bug 622728).
-       CALIBRE_LIB_DIR=/usr/$(get_libdir)/calibre
-       CALIBRE_LIB_CONTENT=$(for x in "${ED}${CALIBRE_LIB_DIR}"/*; do
-               printf -- "${x##*/} "; done) || die "Failed to list 
${ED}${CALIBRE_LIB_DIR}"
-}
-
 pkg_postinst() {
-       [[ -n ${CALIBRE_LIB_DIR} ]] || die "CALIBRE_LIB_DIR is unset"
-       local x
-       for x in "${EROOT}${CALIBRE_LIB_DIR}"/*; do
-               if [[ " ${CALIBRE_LIB_CONTENT} " != *" ${x##*/} "* ]]; then
-                       elog "Purging '${x}'"
-                       rm -rf "${x}"
-               fi
-       done
        xdg_desktop_database_update
        xdg_mimeinfo_database_update
        xdg_icon_cache_update

Reply via email to