• [gentoo-dev] [PATCH 1/1] metadata/install-qa-check.d: add new QA check

    From Sam James@21:1/5 to All on Thu Apr 28 05:20:01 2022
    Very similar to tmpfiles.eclass check (60tmpfiles-paths).

    Three checks:
    1) Verify packages don't install udev rules to /etc/udev/rules.d, which
    is a forbidden (user-configuration) location;

    2) Check whether packages inherit udev.eclass if they're
    installing files to /lib/udev/rules.d/..

    (This helps to catch packages not calling udev_reload
    in pkg_postinst).

    3) Check for missing udev_process calls in pkg_postinst.

    Bug: https://bugs.gentoo.org/433916
    See: c7fe1066a8fcd35f965de4ea16c9cd1001830642
    Signed-off-by: Sam James <sam@gentoo.org>
    ---
    metadata/install-qa-check.d/60udev-eclass | 63 +++++++++++++++++++++++
    1 file changed, 63 insertions(+)
    create mode 100644 metadata/install-qa-check.d/60udev-eclass

    diff --git a/metadata/install-qa-check.d/60udev-eclass b/metadata/install-qa-check.d/60udev-eclass
    new file mode 100644
    index 000000000000..cf8e08e9971e
    --- /dev/null
    +++ b/metadata/install-qa-check.d/60udev-eclass
    @@ -0,0 +1,63 @@
    +# Copyright 2021-2022 Gentoo Authors
    +# Distributed under the terms of the GNU General Public License v2
    +
    +# QA check: ensure that packages installing udev rules inherit the eclass
    +# Maintainer: Sam James <sam@gentoo.org>
    +
    +# Implements three checks:
    +# 1) Installation to /etc/udev/rules.d (which is a user-customization location);
    +# 2) Installation of any udev rules to /lib/udev/rules.d without inheriting the eclass
    +# (needed for udev_reload in pkg_postinst);
    +# 3) Check for installation of udev rules without calling udev_reload in
    +# pkg_postinst.
    +udev_rules_check() {
    + # Ch