Gentoo Archives: gentoo-dev

From: Georgy Yakovlev <gyakovlev@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] [PATCH] metadata/install-qa-check.d: add 60tmpfiles-path QA check
Date: Mon, 02 Aug 2021 08:51:47
Message-Id: 5919252.44csPzL39Z@cerberus
In Reply to: Re: [gentoo-dev] [PATCH] metadata/install-qa-check.d: add 60tmpfiles-path QA check by "Michał Górny"
1 On Monday, August 2, 2021 1:30:07 AM PDT Michał Górny wrote:
2 > On Mon, 2021-08-02 at 01:28 -0700, Georgy Yakovlev wrote:
3 > > it can actually check if ebuild calls tmpfiles_process, not only
4 > > inherit.
5 > > something like:
6 > >
7 > > local pkg_postinst_body="$(declare -fp pkg_postinst)"
8 > > if [[ ! ${pkg_postinst_body} == *tmpfiles_process* ]]; then
9 > > eqawarn "QA Notice: package is installing tmpfiles without
10 > > calling
11 > > eqawarn "tmpfiles_process in pkg_postinst phase"
12 > > fi
13 > >
14 > > ofc accounting for edge cases floppym mentioned.
15 >
16 > This is going to cause false positives if tmpfiles_process is called via
17 > another function.
18
19 ineed, but seems there are no such cases yet.
20 simple test (via ripgrep): prints all files calling tmpfiles_process at any
21 point, and checks if any files from the list do not have a string ^pkg_postinst
22 it may not catch all ofc, because it does not check where call happens or if
23 it's actually defined, but I think it's good enough.
24
25 rg tmpfiles_process --files-with-matches | xargs rg ^pkg_postinst --files-
26 without-match
27
28 1 result, eclass/tmpfiles.eclass, which is fine.
29
30 I think adding body checker outweighs possible edge case yet to happen.
31 ebuilds not calling it already happened, we fixed some.
32 for example, logrotate was broken out of the box on systemd.
33
34 --
35 Best regards,
36 Georgy