app-text/calibre: revbump to 3.1.1-r2 with fix for bug 622728
authorZac Medico <zmedico@gentoo.org>
Mon, 26 Jun 2017 22:13:31 +0000 (15:13 -0700)
committerZac Medico <zmedico@gentoo.org>
Mon, 26 Jun 2017 22:17:48 +0000 (15:17 -0700)
Indentify and purge stray directories from upstream's "Binary install"
method.

Package-Manager: Portage-2.3.6, Repoman-2.3.2

app-text/calibre/calibre-3.1.1-r2.ebuild [moved from app-text/calibre/calibre-3.1.1-r1.ebuild with 93% similarity]

similarity index 93%
rename from app-text/calibre/calibre-3.1.1-r1.ebuild
rename to app-text/calibre/calibre-3.1.1-r2.ebuild
index 4e9fbac4f7fd5bc940d6c83eca8a4210a1d4c355..46710a8a8454c3725248a5e9559d04f962cddb65 100644 (file)
@@ -249,7 +249,23 @@ src_install() {
 
 }
 
+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
        fdo-mime_desktop_database_update
        fdo-mime_mime_database_update
 }