On Monday, August 2, 2021 1:30:07 AM PDT Michał Górny wrote:
> On Mon, 2021-08-02 at 01:28 -0700, Georgy Yakovlev wrote:
> > it can actually check if ebuild calls tmpfiles_process, not only
> > inherit.
> > something like:
> > 
> >     local pkg_postinst_body="$(declare -fp pkg_postinst)"
> >     if [[ ! ${pkg_postinst_body} == *tmpfiles_process* ]]; then
> >         eqawarn "QA Notice: package is installing tmpfiles without
> > calling
> >         eqawarn "tmpfiles_process in pkg_postinst phase"
> >     fi
> >    
> > ofc accounting for edge cases floppym mentioned.
> 
> This is going to cause false positives if tmpfiles_process is called via
> another function.

ineed, but seems there are no such cases yet.
simple test (via ripgrep): prints all files calling tmpfiles_process at any 
point, and checks if any files from the list do not have a string ^pkg_postinst
it  may not catch all ofc, because it does not check where call happens or if 
it's actually defined, but I think it's good enough.

rg tmpfiles_process --files-with-matches | xargs rg ^pkg_postinst --files-
without-match

1 result, eclass/tmpfiles.eclass, which is fine.

I think adding body checker outweighs possible edge case yet to happen.
ebuilds not calling it already happened, we fixed some.
for example, logrotate was broken out of the box on systemd.

-- 
Best regards,
Georgy




Reply via email to