It's okay to use "keepdir" on /etc/tmpfiles.d.

See: 
https://archives.gentoo.org/gentoo-dev/message/50558b55dc34f37b238807fc4759640d
Signed-off-by: Sam James <s...@gentoo.org>
---
 metadata/install-qa-check.d/60tmpfiles-paths | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/metadata/install-qa-check.d/60tmpfiles-paths 
b/metadata/install-qa-check.d/60tmpfiles-paths
index ed0bdbff8cd5..5ef56885ebe7 100644
--- a/metadata/install-qa-check.d/60tmpfiles-paths
+++ b/metadata/install-qa-check.d/60tmpfiles-paths
@@ -11,7 +11,12 @@
 tmpfiles_check() {
        # Check 1
        # Scan image for files in /etc/tmpfiles.d which is a forbidden location
-       if [[ -d "${ED}"/etc/tmpfiles.d/ ]] ; then
+       # (We use this glob to avoid triggering on keepdir)
+       shopt -s nullglob
+       local files=( "${ED}"/etc/tmpfiles.d/*.conf )
+       shopt -u nullglob
+
+       if [[ ${#files[@]} -gt 0 ]]; then
                eqawarn "QA Notice: files installed to /etc/tmpfiles.d"
                eqawarn "tmpfiles configuration files must be installed by 
ebuilds /usr/lib/tmpfiles.d!"
        fi
-- 
2.32.0


Reply via email to