commit:     27e725ed6e7991b4267e5002376f497781f8c224
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Aug 13 01:39:02 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Aug 16 02:12:07 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=27e725ed

metadata/install-qa-check.d: only trigger on tmpfiles in forbidden location

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

See: 
https://archives.gentoo.org/gentoo-dev/message/50558b55dc34f37b238807fc4759640d
Signed-off-by: Sam James <sam <AT> 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 ed0bdbff8cd..5ef56885ebe 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

Reply via email to