app-portage/eix: Own the cache directory
authorMichał Górny <mgorny@gentoo.org>
Tue, 1 Nov 2016 18:44:27 +0000 (19:44 +0100)
committerMichał Górny <mgorny@gentoo.org>
Sun, 6 Nov 2016 15:34:35 +0000 (16:34 +0100)
app-portage/eix/eix-0.32.1-r1.ebuild [moved from app-portage/eix/eix-0.32.1.ebuild with 91% similarity]

similarity index 91%
rename from app-portage/eix/eix-0.32.1.ebuild
rename to app-portage/eix/eix-0.32.1-r1.ebuild
index 57695a9fba1cb0741c587db68013de3d3a79c16b..4665d7be271403fde030b5caf6c4752601dcb95a 100644 (file)
@@ -75,15 +75,15 @@ src_install() {
        default
        dobashcomp bash/eix
        systemd_dotmpfilesd tmpfiles.d/eix.conf
+
+       keepdir /var/cache/eix
 }
 
 pkg_postinst() {
-       local cache=${EROOT%/}/var/cache/${PN}
-       if [[ ! -d ${cache} ]]; then
-               mkdir "${cache}" || die
-               if ! use prefix; then
-                       chown portage:portage "${cache}" || die
-               fi
+       if ! use prefix; then
+               # note: if this is done in src_install(), portage:portage
+               # ownership may be reset to root
+               fowners portage:portage "${EROOT%/}"/var/cache/eix
        fi
 
        local obs=${EROOT%/}/var/cache/eix.previous