app-portage/gentoolkit: Create /var/cache/revdep-rebuild in pkg_postinst
authorMike Gilbert <floppym@gentoo.org>
Sat, 12 Mar 2016 16:40:29 +0000 (11:40 -0500)
committerMike Gilbert <floppym@gentoo.org>
Sat, 12 Mar 2016 17:36:19 +0000 (12:36 -0500)
This resolves a QA warning.

QA Notice: This ebuild installs into paths that should be created at runtime.
 To fix, simply do not install into these directories.  Instead, your package
 should create dirs on the fly at runtime as needed via init scripts/etc...

  var/cache
  var/cache/revdep-rebuild
  var/cache/revdep-rebuild/.keep_app-portage_gentoolkit-0

We already install a tmpfiles entry to recreate the directory on boot.

Package-Manager: portage-2.2.28_p57

app-portage/gentoolkit/gentoolkit-0.3.1-r1.ebuild [moved from app-portage/gentoolkit/gentoolkit-0.3.1.ebuild with 93% similarity]
app-portage/gentoolkit/gentoolkit-9999.ebuild

similarity index 93%
rename from app-portage/gentoolkit/gentoolkit-0.3.1.ebuild
rename to app-portage/gentoolkit/gentoolkit-0.3.1-r1.ebuild
index 7621d423fa82d2f34efa281012c03ccd1c636188..55d3f21ae4fc4b8a84221904a0bb048030a3b99a 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2016 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
@@ -38,11 +38,6 @@ python_prepare_all() {
 python_install_all() {
        distutils-r1_python_install_all
 
-       # Create cache directory for revdep-rebuild
-       keepdir /var/cache/revdep-rebuild
-       use prefix || fowners root:0 /var/cache/revdep-rebuild
-       fperms 0700 /var/cache/revdep-rebuild
-
        # remove on Gentoo Prefix platforms where it's broken anyway
        if use prefix; then
                elog "The revdep-rebuild command is removed, the preserve-libs"
@@ -55,6 +50,10 @@ python_install_all() {
 }
 
 pkg_postinst() {
+       # Create cache directory for revdep-rebuild
+       mkdir -p -m 0755 "${EROOT%/}"/var/cache
+       mkdir -p -m 0700 "${EROOT%/}"/var/cache/revdep-rebuild
+
        # Only show the elog information on a new install
        if [[ ! ${REPLACING_VERSIONS} ]]; then
                elog
index bba13e510f8f3da3653c9bad28cee7cf09e4c7a9..436c76f0c0b59bb21657a1c0cec510004a36c08f 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2016 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
@@ -39,11 +39,6 @@ python_prepare_all() {
 python_install_all() {
        distutils-r1_python_install_all
 
-       # Create cache directory for revdep-rebuild
-       keepdir /var/cache/revdep-rebuild
-       use prefix || fowners root:0 /var/cache/revdep-rebuild
-       fperms 0700 /var/cache/revdep-rebuild
-
        # remove on Gentoo Prefix platforms where it's broken anyway
        if use prefix; then
                elog "The revdep-rebuild command is removed, the preserve-libs"
@@ -56,6 +51,10 @@ python_install_all() {
 }
 
 pkg_postinst() {
+       # Create cache directory for revdep-rebuild
+       mkdir -p -m 0755 "${EROOT%/}"/var/cache
+       mkdir -p -m 0700 "${EROOT%/}"/var/cache/revdep-rebuild
+
        # Only show the elog information on a new install
        if [[ ! ${REPLACING_VERSIONS} ]]; then
                elog