From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: metadata/install-qa-check.d/
Date: Mon, 16 Aug 2021 02:12:20 +0000 (UTC) [thread overview]
Message-ID: <1629079929.f653e0b5ff5620e852e5fbbd23d62fa3577f2a7d.sam@gentoo> (raw)
commit: f653e0b5ff5620e852e5fbbd23d62fa3577f2a7d
Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
AuthorDate: Fri Aug 13 01:52:38 2021 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Aug 16 02:12:09 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f653e0b5
metadata/install-qa-check.d: add check for missing tmpfiles_process call
See: https://archives.gentoo.org/gentoo-dev/message/7bdfdc9a7560fd07436defd0253af0b8
Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>
Signed-off-by: Sam James <sam <AT> gentoo.org>
metadata/install-qa-check.d/60tmpfiles-paths | 34 ++++++++++++++++++++--------
1 file changed, 24 insertions(+), 10 deletions(-)
diff --git a/metadata/install-qa-check.d/60tmpfiles-paths b/metadata/install-qa-check.d/60tmpfiles-paths
index 81286de584a..aa666dfb7ce 100644
--- a/metadata/install-qa-check.d/60tmpfiles-paths
+++ b/metadata/install-qa-check.d/60tmpfiles-paths
@@ -3,11 +3,14 @@
# QA check: ensure that packages installing tmpfiles configuration inherit the eclass
# Maintainer: Sam James <sam@gentoo.org>
+# Maintainer: Georgy Yakovlev <gyakovlev@gentoo.org>
# Implements two checks:
# 1) Installation to /etc/tmpfiles.d (which is a user-customization location);
# 2) Installation of any tmpfiles to /usr/lib/tmpfiles.d without inheriting the eclass
-# (needed for tmpfiles_process in pkg_postinst)
+# (needed for tmpfiles_process in pkg_postinst);
+# 3) Check for installation of tmpfiles without calling tmpfiles_process in
+# pkg_postinst.
tmpfiles_check() {
# Check 1
# Scan image for files in /etc/tmpfiles.d which is a forbidden location
@@ -17,30 +20,41 @@ tmpfiles_check() {
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!"
+ eqawarn "QA Notice: files installed to /etc/tmpfiles.d found"
+ eqawarn "tmpfiles configuration files supplied by ebuilds must be installed to /usr/lib/tmpfiles.d"
fi
# Check 2
# We're now going to check for whether we install files to /usr/lib/tmpfiles.d without
# inheriting the eclass (weak catch for ebuilds not calling tmpfiles_process in pkg_postinst)
- # No need to carry on if we're inheriting the eclass
- if has tmpfiles ${INHERITED} ; then
- return
- fi
-
# It's okay for some packages to do this because of circular dependencies and such
# See: https://archives.gentoo.org/gentoo-dev/message/0a96793036a4fdd9ac311a46950d7e7b
# TODO: Standardize some way of allowing ebuilds to opt-out of checks like this
local package=${CATEGORY}/${PN}
+
if [[ ${package} == "sys-apps/systemd" || ${package} == "sys-libs/pam" ]] ; then
return
fi
if [[ -d "${ED}"/usr/lib/tmpfiles.d/ ]] ; then
- eqawarn "QA Notice: package is installing tmpfiles without inheriting tmpfiles.eclass!"
- eqawarn "Packages must inherit tmpfiles.eclass then call tmpfiles_process in pkg_postinst."
+ if ! has tmpfiles ${INHERITED} ; then
+ eqawarn "QA Notice: package is installing tmpfiles without inheriting tmpfiles.eclass!"
+ eqawarn "Packages must inherit tmpfiles.eclass then call tmpfiles_process in pkg_postinst."
+ return
+ fi
+
+ # Check 3
+ # Check whether we're installing tmpfiles without explicitly
+ # calling tmpfiles_process in pkg_postinst, but we have inherited
+ # the eclass.
+ # Small risk of false positives if called indirectly.
+ # See: https://archives.gentoo.org/gentoo-dev/message/7bdfdc9a7560fd07436defd0253af0b8
+ local pkg_postinst_body="$(declare -fp pkg_postinst 2>&1)"
+ if [[ ! ${pkg_postinst_body} == *tmpfiles_process* ]] ; then
+ eqawarn "QA Notice: package is installing tmpfiles without calling"
+ eqawarn "tmpfiles_process in pkg_postinst phase"
+ fi
fi
}
next reply other threads:[~2021-08-16 20:48 UTC|newest]
Thread overview: 85+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-16 2:12 Sam James [this message]
-- strict thread matches above, loose matches on Subject: below --
2025-08-13 4:59 [gentoo-commits] repo/gentoo:master commit in: metadata/install-qa-check.d/ Arthur Zamarin
2025-08-13 4:59 Arthur Zamarin
2025-06-01 12:35 Michał Górny
2025-04-19 1:27 Sam James
2025-04-18 17:21 Michał Górny
2025-04-18 15:22 Arthur Zamarin
2025-04-16 0:54 Michał Górny
2025-04-16 0:54 Michał Górny
2024-10-21 15:12 Michał Górny
2024-09-05 8:43 Michał Górny
2024-03-29 18:47 Sam James
2024-01-08 14:48 Michał Górny
2024-01-08 14:48 Michał Górny
2024-01-08 14:48 Michał Górny
2024-01-08 14:48 Michał Górny
2024-01-08 14:48 Michał Górny
2024-01-08 14:48 Michał Górny
2024-01-08 14:48 Michał Górny
2024-01-08 14:48 Michał Górny
2024-01-08 14:48 Michał Górny
2023-08-17 22:08 Ulrich Müller
2023-05-17 3:40 Michał Górny
2022-09-19 3:52 Sam James
2022-08-21 2:31 Sam James
2022-08-04 23:49 Sam James
2022-08-03 18:56 Sam James
2022-08-03 4:27 Sam James
2022-08-03 1:53 Sam James
2022-08-02 4:08 Michał Górny
2022-07-16 11:26 Michał Górny
2022-06-08 0:25 Mike Gilbert
2022-05-06 12:48 Ionen Wolkens
2022-05-05 23:38 Sam James
2022-05-02 6:01 Agostino Sarubbo
2022-04-30 19:13 Sam James
2022-04-28 3:06 Sam James
2022-04-27 0:13 Sam James
2022-04-26 23:45 Sam James
2022-04-26 15:32 Sam James
2022-04-19 18:31 Sam James
2022-04-19 18:31 Sam James
2022-04-17 14:21 Sam James
2022-04-17 14:18 Sam James
2022-03-04 1:26 Sam James
2022-03-04 1:26 Sam James
2022-02-01 18:19 Mike Gilbert
2022-02-01 1:37 Mike Gilbert
2022-01-16 9:40 Michał Górny
2021-08-19 1:35 Sam James
2021-08-16 2:12 Sam James
2021-08-16 2:12 Sam James
2021-08-16 2:12 Sam James
2021-08-02 8:17 Michał Górny
2021-07-03 8:16 Michał Górny
2021-07-01 8:57 Georgy Yakovlev
2021-06-28 18:47 Georgy Yakovlev
2021-06-28 8:56 Georgy Yakovlev
2021-06-28 0:12 Georgy Yakovlev
2021-06-27 2:08 Sam James
2021-06-26 23:25 Georgy Yakovlev
2021-06-26 23:09 Georgy Yakovlev
2021-05-29 15:15 Michał Górny
2021-05-25 5:13 Michał Górny
2021-04-29 11:42 Michał Górny
2021-04-29 11:42 Michał Górny
2021-04-29 11:42 Michał Górny
2021-04-29 11:42 Michał Górny
2021-04-09 23:17 Sam James
2020-10-17 19:01 Michał Górny
2020-10-16 7:42 Michał Górny
2020-09-22 11:12 Michał Górny
2020-09-22 7:33 Michał Górny
2020-09-22 7:00 Michał Górny
2020-09-22 7:00 Michał Górny
2020-09-21 17:48 Michał Górny
2020-09-21 15:30 Michał Górny
2020-02-13 18:59 Georgy Yakovlev
2020-01-20 20:45 Michael Orlitzky
2019-12-30 16:10 Michał Górny
2019-11-12 7:53 Sergei Trofimovich
2019-11-11 23:05 Zac Medico
2019-11-11 22:25 Sergei Trofimovich
2019-11-01 13:16 Michał Górny
2018-10-06 8:35 Michał Górny
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1629079929.f653e0b5ff5620e852e5fbbd23d62fa3577f2a7d.sam@gentoo \
--to=sam@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox