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

Bug: https://bugs.gentoo.org/774855
Signed-off-by: Mike Gilbert <[email protected]>
---
 eclass/tmpfiles.eclass | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/eclass/tmpfiles.eclass b/eclass/tmpfiles.eclass
index 360c5e3b816f..632343821648 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> ...
-- 
2.31.0.rc1


Reply via email to