commit:     6e4f0c0765f07696ed3b10be96a54a4a6810ac46
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Mon Mar  8 19:35:45 2021 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Mon Mar  8 22:29:42 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6e4f0c07

tmpfiles.eclass: introduce TMPFILES_OPTIONAL variable

This allows the automatic dependency on virtual/tmpfiles to be disabled.

Bug: https://bugs.gentoo.org/774855
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
Acked-by: David Seifert <soap <AT> gentoo.org>

 eclass/tmpfiles.eclass | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/eclass/tmpfiles.eclass b/eclass/tmpfiles.eclass
index 360c5e3b816..63234382164 100644
--- a/eclass/tmpfiles.eclass
+++ b/eclass/tmpfiles.eclass
@@ -60,7 +60,15 @@ case "${EAPI}" in
 *) die "API is undefined for EAPI ${EAPI}" ;;
 esac
 
-RDEPEND="virtual/tmpfiles"
+# @ECLASS-VARIABLE: TMPFILES_OPTIONAL
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# When not empty, disables the dependency on virtual/tmpfiles.
+# Ebuilds that call tmpfiles_process conditionally should declare a
+# conditional dependency themselves.
+if [[ -z ${TMPFILES_OPTIONAL} ]]; then
+       RDEPEND="virtual/tmpfiles"
+fi
 
 # @FUNCTION: dotmpfiles
 # @USAGE: <tmpfiles.d_file> ...

Reply via email to