• [gentoo-dev] [PATCH] systemd.eclass: make all fallback paths use /usr/l

    From Eli Schwartz@21:1/5 to All on Wed Apr 23 17:00:01 2025
    Back in 2018, the eclass was changed to ensure that the canonical path
    used for results was in /lib, since that works for split-usr systems
    running systemd while also supporting merged-usr systems due to portage following symlinks at install time. It even works for binpkgs.

    But here and now in 2025, systemd doesn't support split-usr at all.
    There is no point in having unit files install conservatively in
    /lib/systemd. Update the path to accommodate the new reality.

    This mostly has no effect. On openrc profiles, or for packages that use systemd_dounit without pulling in pkgconfig, binpkgs will be created
    with a different, but still working path, which then triggers iwdevtools warnings when you reinstall a former binpkg from source, as it thinks
    the file has "moved". e.g.

    ```
    * CMP: =net-misc/radvd-2.19-r7 with net-misc/radvd-2.20/image
    * FILES:-lib/systemd/system/radvd.service
    * FILES:+usr/lib/systemd/system/radvd.service
    * ------> FILES(+1,-1)
    ```

    Signed-off-by: Eli Schwartz <eschwartz@gentoo.org>
    ---
    eclass/systemd.eclass | 12 ++++++------
    eclass/tests/systemd.sh | 10 +++++-----
    2 files changed, 11 insertions(+), 11 deletions(-)

    diff --git a/eclass/systemd.eclass b/eclass/systemd.eclass
    index f908ad688d9d..f0b4b79d9c32 100644
    --- a/eclass/systemd.eclass
    +++ b/eclass/systemd.eclass
    @@ -1,4 +1,4 @@
    -# Copyright 2011-2024 Gentoo Authors
    +# Copyright 2011-2025 Gentoo Authors
    # Distributed under the terms of the GNU General Public License v2

    # @ECLASS: systemd.eclass
    @@ -77,7 +77,7 @@ _systemd_unprefix() {
    systemd_get_systemunitdir() {
    debug-print-function ${FUNCNAME} "$@"

    - _systemd_get_dir systemdsystemunitdir /lib/systemd/system
    + _systemd_get_dir systemdsystemunitdir /usr/lib/systemd/system
    }

    # @FUNCTION: systemd_get_userunitdir
    @@ -99,7 +99,7 @@ systemd_get_userunitdir() {
    systemd_get_utildir() {
    debug-print-function ${FUNCNAME} "$@"

    - _systemd_get_dir systemdutildir /lib/systemd
    + _systemd_get_dir systemdutildir /usr/lib/systemd
    }

    # @FUNCTION: sy