diff options
author | Mike Frysinger <vapier@gentoo.org> | 2016-12-15 10:22:01 -0500 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2016-12-15 10:53:24 -0500 |
commit | d642644bfbd0ba605c561fefcbf6df58f30b6a84 (patch) | |
tree | 30d7f97f42b2410217d851919c7ea594bafab3de | |
parent | dev-perl/Moose: Bump to version 2.180.600 (diff) | |
download | gentoo-d642644bfbd0ba605c561fefcbf6df58f30b6a84.tar.gz gentoo-d642644bfbd0ba605c561fefcbf6df58f30b6a84.tar.bz2 gentoo-d642644bfbd0ba605c561fefcbf6df58f30b6a84.zip |
sys-apps/man-db: move /var cache dir creation to runtime #520464
The rework in pkg_preinst is just about moving the path into a var.
Otherwise, we just add some -d/mkdir testing logic to the end.
-rw-r--r-- | sys-apps/man-db/man-db-2.7.6.1-r1.ebuild | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/sys-apps/man-db/man-db-2.7.6.1-r1.ebuild b/sys-apps/man-db/man-db-2.7.6.1-r1.ebuild index 0f4cb33a17f8..035cc343b310 100644 --- a/sys-apps/man-db/man-db-2.7.6.1-r1.ebuild +++ b/sys-apps/man-db/man-db-2.7.6.1-r1.ebuild @@ -69,21 +69,21 @@ src_install() { exeinto /etc/cron.daily newexe "${FILESDIR}"/man-db.cron man-db #289884 - - keepdir /var/cache/man - fowners man:man /var/cache/man - fperms 0755 /var/cache/man } pkg_preinst() { - if [[ -f ${EROOT}var/cache/man/whatis ]] ; then - einfo "Cleaning ${EROOT}var/cache/man from sys-apps/man" - find "${EROOT}"var/cache/man -type f '!' '(' -name index.bt -o -name index.db ')' -delete + local cachedir="${EROOT}var/cache/man" + if [[ -f ${cachedir}/whatis ]] ; then + einfo "Cleaning ${cachedir} from sys-apps/man" + find "${cachedir}" -type f '!' '(' -name index.bt -o -name index.db ')' -delete fi - if [[ -g ${EROOT}var/cache/man ]] ; then - einfo "Resetting permissions on ${EROOT}var/cache/man" - chown -R man:man "${EROOT}"var/cache/man - find "${EROOT}"var/cache/man -type d -exec chmod g-s {} + + if [[ -g ${cachedir} ]] ; then + einfo "Resetting permissions on ${cachedir}" + chown -R man:man "${cachedir}" || die + find "${cachedir}" -type d -exec chmod g-s {} + || die + elif [[ ! -d ${cachedir} ]] ; then + mkdir -p "${cachedir}" || die + chown man:man "${cachedir}" || die fi } |