summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRepository mirror & CI <repomirrorci@gentoo.org>2022-10-15 17:49:02 +0000
committerRepository mirror & CI <repomirrorci@gentoo.org>2022-10-15 17:49:02 +0000
commit7d5097f5501098c298405db761d9a7bc2cc24403 (patch)
treecdef6faab83429fd532d075b2d6c436249c26488
parent2022-10-15 17:34:00 UTC (diff)
parentprofiles: move merged-usr profiles from dev to stable (diff)
downloadgentoo-7d5097f5501098c298405db761d9a7bc2cc24403.tar.gz
gentoo-7d5097f5501098c298405db761d9a7bc2cc24403.tar.bz2
gentoo-7d5097f5501098c298405db761d9a7bc2cc24403.zip
Merge updates from master
-rw-r--r--eclass/systemd.eclass77
-rwxr-xr-xeclass/tests/systemd.sh50
-rw-r--r--profiles/profiles.desc50
3 files changed, 102 insertions, 75 deletions
diff --git a/eclass/systemd.eclass b/eclass/systemd.eclass
index 7731bede094e..fbed387e0ca0 100644
--- a/eclass/systemd.eclass
+++ b/eclass/systemd.eclass
@@ -1,4 +1,4 @@
-# Copyright 2011-2021 Gentoo Authors
+# Copyright 2011-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: systemd.eclass
@@ -53,20 +53,21 @@ _systemd_get_dir() {
if $(tc-getPKG_CONFIG) --exists systemd; then
d=$($(tc-getPKG_CONFIG) --variable="${variable}" systemd) || die
- d=${d#${EPREFIX}}
else
- d=${fallback}
+ d="${EPREFIX}${fallback}"
fi
echo "${d}"
}
-# @FUNCTION: _systemd_get_systemunitdir
+# @FUNCTION: _systemd_unprefix
+# @USAGE: <function-name>
# @INTERNAL
# @DESCRIPTION:
-# Get unprefixed unitdir.
-_systemd_get_systemunitdir() {
- _systemd_get_dir systemdsystemunitdir /lib/systemd/system
+# Calls the specified function and removes ${EPREFIX} from the result.
+_systemd_unprefix() {
+ local d=$("${@}")
+ echo "${d#"${EPREFIX}"}"
}
# @FUNCTION: systemd_get_systemunitdir
@@ -77,7 +78,7 @@ _systemd_get_systemunitdir() {
systemd_get_systemunitdir() {
debug-print-function ${FUNCNAME} "${@}"
- echo "${EPREFIX}$(_systemd_get_systemunitdir)"
+ _systemd_get_dir systemdsystemunitdir /lib/systemd/system
}
# @FUNCTION: systemd_get_unitdir
@@ -89,14 +90,6 @@ systemd_get_unitdir() {
systemd_get_systemunitdir
}
-# @FUNCTION: _systemd_get_userunitdir
-# @INTERNAL
-# @DESCRIPTION:
-# Get unprefixed userunitdir.
-_systemd_get_userunitdir() {
- _systemd_get_dir systemduserunitdir /usr/lib/systemd/user
-}
-
# @FUNCTION: systemd_get_userunitdir
# @DESCRIPTION:
# Output the path for the systemd user unit directory (not including
@@ -105,15 +98,7 @@ _systemd_get_userunitdir() {
systemd_get_userunitdir() {
debug-print-function ${FUNCNAME} "${@}"
- echo "${EPREFIX}$(_systemd_get_userunitdir)"
-}
-
-# @FUNCTION: _systemd_get_utildir
-# @INTERNAL
-# @DESCRIPTION:
-# Get unprefixed utildir.
-_systemd_get_utildir() {
- _systemd_get_dir systemdutildir /lib/systemd
+ _systemd_get_dir systemduserunitdir /usr/lib/systemd/user
}
# @FUNCTION: systemd_get_utildir
@@ -124,15 +109,7 @@ _systemd_get_utildir() {
systemd_get_utildir() {
debug-print-function ${FUNCNAME} "${@}"
- echo "${EPREFIX}$(_systemd_get_utildir)"
-}
-
-# @FUNCTION: _systemd_get_systemgeneratordir
-# @INTERNAL
-# @DESCRIPTION:
-# Get unprefixed systemgeneratordir.
-_systemd_get_systemgeneratordir() {
- _systemd_get_dir systemdsystemgeneratordir /lib/systemd/system-generators
+ _systemd_get_dir systemdutildir /lib/systemd
}
# @FUNCTION: systemd_get_systemgeneratordir
@@ -142,15 +119,7 @@ _systemd_get_systemgeneratordir() {
systemd_get_systemgeneratordir() {
debug-print-function ${FUNCNAME} "${@}"
- echo "${EPREFIX}$(_systemd_get_systemgeneratordir)"
-}
-
-# @FUNCTION: _systemd_get_systempresetdir
-# @INTERNAL
-# @DESCRIPTION:
-# Get unprefixed systempresetdir.
-_systemd_get_systempresetdir() {
- _systemd_get_dir systemdsystempresetdir /lib/systemd/system-preset
+ _systemd_get_dir systemdsystemgeneratordir /lib/systemd/system-generators
}
# @FUNCTION: systemd_get_systempresetdir
@@ -160,7 +129,15 @@ _systemd_get_systempresetdir() {
systemd_get_systempresetdir() {
debug-print-function ${FUNCNAME} "${@}"
- echo "${EPREFIX}$(_systemd_get_systempresetdir)"
+ _systemd_get_dir systemdsystempresetdir /lib/systemd/system-preset
+}
+
+# @FUNCTION: systemd_get_sleepdir
+# @DESCRIPTION:
+# Output the path for the system sleep directory.
+systemd_get_sleepdir() {
+ debug-print-function ${FUNCNAME} "${@}"
+ _systemd_get_dir systemdsleepdir /lib/systemd/system-sleep
}
# @FUNCTION: systemd_dounit
@@ -172,7 +149,7 @@ systemd_dounit() {
(
insopts -m 0644
- insinto "$(_systemd_get_systemunitdir)"
+ insinto "$(_systemd_unprefix systemd_get_systemunitdir)"
doins "${@}"
)
}
@@ -186,7 +163,7 @@ systemd_newunit() {
(
insopts -m 0644
- insinto "$(_systemd_get_systemunitdir)"
+ insinto "$(_systemd_unprefix systemd_get_systemunitdir)"
newins "${@}"
)
}
@@ -200,7 +177,7 @@ systemd_douserunit() {
(
insopts -m 0644
- insinto "$(_systemd_get_userunitdir)"
+ insinto "$(_systemd_unprefix systemd_get_userunitdir)"
doins "${@}"
)
}
@@ -215,7 +192,7 @@ systemd_newuserunit() {
(
insopts -m 0644
- insinto "$(_systemd_get_userunitdir)"
+ insinto "$(_systemd_unprefix systemd_get_userunitdir)"
newins "${@}"
)
}
@@ -262,7 +239,7 @@ systemd_enable_service() {
local target=${1}
local service=${2}
- local ud=$(_systemd_get_systemunitdir)
+ local ud=$(_systemd_unprefix systemd_get_systemunitdir)
local destname=${service##*/}
dodir "${ud}"/"${target}".wants && \
@@ -306,7 +283,7 @@ systemd_enable_ntpunit() {
(
insopts -m 0644
- insinto "$(_systemd_get_utildir)"/ntp-units.d
+ insinto "$(_systemd_unprefix systemd_get_utildir)"/ntp-units.d
doins "${T}"/${ntpunit_name}.list
)
local ret=${?}
diff --git a/eclass/tests/systemd.sh b/eclass/tests/systemd.sh
new file mode 100755
index 000000000000..f870df4b7a12
--- /dev/null
+++ b/eclass/tests/systemd.sh
@@ -0,0 +1,50 @@
+#!/usr/bin/env bash
+# Copyright 2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+source tests-common.sh || exit
+
+inherit systemd
+
+test_system_dir() {
+ local exp1="${EPREFIX}$1"
+ local exp2="${EPREFIX}/usr$1"
+ shift
+ tbegin "$@"
+ local act=$("$@")
+ [[ ${act} == ${exp1} || ${act} == ${exp2} ]]
+ tend $?
+}
+
+test_user_dir() {
+ local exp="${EPREFIX}$1"
+ shift
+ tbegin "$@"
+ local act=$("$@")
+ [[ ${act} == ${exp} ]]
+ tend $?
+}
+
+test_systemd_unprefix() {
+ local exp=$1
+ local EPREFIX=$2
+ shift 2
+ tbegin "EPREFIX=${EPREFIX} _systemd_unprefix $@"
+ [[ "$(_systemd_unprefix "$@")" == "${exp}" ]]
+ tend $?
+}
+
+test_system_dir /lib/systemd/system systemd_get_systemunitdir
+test_system_dir /lib/systemd systemd_get_utildir
+test_system_dir /lib/systemd/system-generators systemd_get_systemgeneratordir
+test_system_dir /lib/systemd/system-preset systemd_get_systempresetdir
+test_system_dir /lib/systemd/system-sleep systemd_get_sleepdir
+
+test_user_dir /usr/lib/systemd/user systemd_get_userunitdir
+
+test_systemd_unprefix /lib/systemd /prefix echo /prefix/lib/systemd
+test_systemd_unprefix /lib/systemd '' echo /lib/systemd
+test_systemd_unprefix /lib/systemd '/*' echo '/*/lib/systemd'
+
+texit
diff --git a/profiles/profiles.desc b/profiles/profiles.desc
index e9699540ae06..3c83ad1b7cd7 100644
--- a/profiles/profiles.desc
+++ b/profiles/profiles.desc
@@ -30,12 +30,12 @@ amd64 default/linux/amd64/17.1/hardened/selinux stable
amd64 default/linux/amd64/17.1/desktop stable
amd64 default/linux/amd64/17.1/desktop/gnome stable
amd64 default/linux/amd64/17.1/desktop/gnome/systemd stable
-amd64 default/linux/amd64/17.1/desktop/gnome/systemd/merged-usr dev
+amd64 default/linux/amd64/17.1/desktop/gnome/systemd/merged-usr stable
amd64 default/linux/amd64/17.1/desktop/plasma stable
amd64 default/linux/amd64/17.1/desktop/plasma/systemd stable
-amd64 default/linux/amd64/17.1/desktop/plasma/systemd/merged-usr dev
+amd64 default/linux/amd64/17.1/desktop/plasma/systemd/merged-usr stable
amd64 default/linux/amd64/17.1/desktop/systemd stable
-amd64 default/linux/amd64/17.1/desktop/systemd/merged-usr dev
+amd64 default/linux/amd64/17.1/desktop/systemd/merged-usr stable
amd64 default/linux/amd64/17.1/developer exp
amd64 default/linux/amd64/17.1/no-multilib stable
amd64 default/linux/amd64/17.1/no-multilib/hardened stable
@@ -44,7 +44,7 @@ amd64 default/linux/amd64/17.1/no-multilib/systemd dev
amd64 default/linux/amd64/17.1/no-multilib/systemd/merged-usr dev
amd64 default/linux/amd64/17.1/no-multilib/systemd/selinux exp
amd64 default/linux/amd64/17.1/systemd stable
-amd64 default/linux/amd64/17.1/systemd/merged-usr dev
+amd64 default/linux/amd64/17.1/systemd/merged-usr stable
amd64 default/linux/amd64/17.1/systemd/selinux exp
amd64 default/linux/amd64/17.1/clang exp
amd64 default/linux/amd64/17.1/systemd/clang exp
@@ -130,15 +130,15 @@ arm64 default/linux/arm64/17.0/hardened/selinux dev
arm64 default/linux/arm64/17.0/desktop stable
arm64 default/linux/arm64/17.0/desktop/gnome stable
arm64 default/linux/arm64/17.0/desktop/gnome/systemd stable
-arm64 default/linux/arm64/17.0/desktop/gnome/systemd/merged-usr dev
+arm64 default/linux/arm64/17.0/desktop/gnome/systemd/merged-usr stable
arm64 default/linux/arm64/17.0/desktop/plasma stable
arm64 default/linux/arm64/17.0/desktop/plasma/systemd stable
-arm64 default/linux/arm64/17.0/desktop/plasma/systemd/merged-usr dev
+arm64 default/linux/arm64/17.0/desktop/plasma/systemd/merged-usr stable
arm64 default/linux/arm64/17.0/desktop/systemd stable
-arm64 default/linux/arm64/17.0/desktop/systemd/merged-usr dev
+arm64 default/linux/arm64/17.0/desktop/systemd/merged-usr stable
arm64 default/linux/arm64/17.0/developer exp
arm64 default/linux/arm64/17.0/systemd stable
-arm64 default/linux/arm64/17.0/systemd/merged-usr dev
+arm64 default/linux/arm64/17.0/systemd/merged-usr stable
arm64 default/linux/arm64/17.0/systemd/selinux exp
arm64 default/linux/arm64/17.0/llvm exp
arm64 default/linux/arm64/17.0/systemd/llvm exp
@@ -164,7 +164,7 @@ ia64 default/linux/ia64/17.0 stable
ia64 default/linux/ia64/17.0/desktop stable
ia64 default/linux/ia64/17.0/desktop/gnome stable
ia64 default/linux/ia64/17.0/desktop/gnome/systemd stable
-ia64 default/linux/ia64/17.0/desktop/gnome/systemd/merged-usr dev
+ia64 default/linux/ia64/17.0/desktop/gnome/systemd/merged-usr stable
ia64 default/linux/ia64/17.0/developer exp
ia64 default/linux/ia64/17.0/systemd exp
ia64 default/linux/ia64/17.0/systemd/merged-usr exp
@@ -218,9 +218,9 @@ ppc default/linux/ppc/17.0 stable
ppc default/linux/ppc/17.0/desktop stable
ppc default/linux/ppc/17.0/desktop/gnome stable
ppc default/linux/ppc/17.0/desktop/gnome/systemd stable
-ppc default/linux/ppc/17.0/desktop/gnome/systemd/merged-usr dev
+ppc default/linux/ppc/17.0/desktop/gnome/systemd/merged-usr stable
ppc default/linux/ppc/17.0/systemd stable
-ppc default/linux/ppc/17.0/systemd/merged-usr dev
+ppc default/linux/ppc/17.0/systemd/merged-usr stable
ppc default/linux/ppc/17.0/developer exp
ppc default/linux/ppc/17.0/musl dev
ppc default/linux/ppc/17.0/musl/hardened exp
@@ -231,9 +231,9 @@ ppc64 default/linux/ppc64/17.0 stable
ppc64 default/linux/ppc64/17.0/desktop stable
ppc64 default/linux/ppc64/17.0/desktop/gnome stable
ppc64 default/linux/ppc64/17.0/desktop/gnome/systemd stable
-ppc64 default/linux/ppc64/17.0/desktop/gnome/systemd/merged-usr dev
+ppc64 default/linux/ppc64/17.0/desktop/gnome/systemd/merged-usr stable
ppc64 default/linux/ppc64/17.0/systemd stable
-ppc64 default/linux/ppc64/17.0/systemd/merged-usr dev
+ppc64 default/linux/ppc64/17.0/systemd/merged-usr stable
ppc64 default/linux/ppc64/17.0/developer exp
ppc64 default/linux/ppc64/17.0/musl dev
ppc64 default/linux/ppc64/17.0/musl/hardened exp
@@ -244,14 +244,14 @@ ppc64 default/linux/ppc64le/17.0 stable
ppc64 default/linux/ppc64le/17.0/desktop stable
ppc64 default/linux/ppc64le/17.0/desktop/gnome stable
ppc64 default/linux/ppc64le/17.0/desktop/gnome/systemd stable
-ppc64 default/linux/ppc64le/17.0/desktop/gnome/systemd/merged-usr dev
+ppc64 default/linux/ppc64le/17.0/desktop/gnome/systemd/merged-usr stable
ppc64 default/linux/ppc64le/17.0/desktop/plasma stable
ppc64 default/linux/ppc64le/17.0/desktop/plasma/systemd stable
-ppc64 default/linux/ppc64le/17.0/desktop/plasma/systemd/merged-usr dev
+ppc64 default/linux/ppc64le/17.0/desktop/plasma/systemd/merged-usr stable
ppc64 default/linux/ppc64le/17.0/desktop/systemd stable
-ppc64 default/linux/ppc64le/17.0/desktop/systemd/merged-usr dev
+ppc64 default/linux/ppc64le/17.0/desktop/systemd/merged-usr stable
ppc64 default/linux/ppc64le/17.0/systemd stable
-ppc64 default/linux/ppc64le/17.0/systemd/merged-usr dev
+ppc64 default/linux/ppc64le/17.0/systemd/merged-usr stable
ppc64 default/linux/ppc64le/17.0/developer exp
ppc64 default/linux/ppc64le/17.0/musl dev
ppc64 default/linux/ppc64le/17.0/musl/hardened exp
@@ -269,7 +269,7 @@ riscv default/linux/riscv/20.0/rv64gc/lp64d/desktop/plasma/systemd/merged-usr d
riscv default/linux/riscv/20.0/rv64gc/lp64d/desktop/systemd dev
riscv default/linux/riscv/20.0/rv64gc/lp64d/desktop/systemd/merged-usr dev
riscv default/linux/riscv/20.0/rv64gc/lp64d/systemd stable
-riscv default/linux/riscv/20.0/rv64gc/lp64d/systemd/merged-usr dev
+riscv default/linux/riscv/20.0/rv64gc/lp64d/systemd/merged-usr stable
riscv default/linux/riscv/20.0/rv64gc/lp64 stable
riscv default/linux/riscv/20.0/rv64gc/lp64/desktop dev
riscv default/linux/riscv/20.0/rv64gc/lp64/desktop/gnome dev
@@ -281,7 +281,7 @@ riscv default/linux/riscv/20.0/rv64gc/lp64/desktop/plasma/systemd/merged-usr de
riscv default/linux/riscv/20.0/rv64gc/lp64/desktop/systemd dev
riscv default/linux/riscv/20.0/rv64gc/lp64/desktop/systemd/merged-usr dev
riscv default/linux/riscv/20.0/rv64gc/lp64/systemd stable
-riscv default/linux/riscv/20.0/rv64gc/lp64/systemd/merged-usr dev
+riscv default/linux/riscv/20.0/rv64gc/lp64/systemd/merged-usr stable
riscv default/linux/riscv/20.0/rv64gc/multilib exp
riscv default/linux/riscv/20.0/rv64gc/multilib/systemd exp
riscv default/linux/riscv/20.0/rv64gc/multilib/systemd/merged-usr exp
@@ -291,7 +291,7 @@ riscv default/linux/riscv/20.0/rv64gc/multilib/systemd/merged-usr exp
s390 default/linux/s390/17.0 stable
s390 default/linux/s390/17.0/s390x stable
s390 default/linux/s390/17.0/systemd stable
-s390 default/linux/s390/17.0/systemd/merged-usr dev
+s390 default/linux/s390/17.0/systemd/merged-usr stable
s390 default/linux/s390/17.0/s390x/systemd exp
s390 default/linux/s390/17.0/s390x/systemd/merged-usr exp
@@ -301,12 +301,12 @@ sparc default/linux/sparc/17.0 stable
sparc default/linux/sparc/17.0/desktop stable
sparc default/linux/sparc/17.0/developer exp
sparc default/linux/sparc/17.0/systemd stable
-sparc default/linux/sparc/17.0/systemd/merged-usr dev
+sparc default/linux/sparc/17.0/systemd/merged-usr stable
sparc default/linux/sparc/17.0/64ul stable
sparc default/linux/sparc/17.0/64ul/desktop stable
sparc default/linux/sparc/17.0/64ul/developer exp
sparc default/linux/sparc/17.0/64ul/systemd stable
-sparc default/linux/sparc/17.0/64ul/systemd/merged-usr dev
+sparc default/linux/sparc/17.0/64ul/systemd/merged-usr stable
# x86 Profiles
# @MAINTAINER: x86@gentoo.org
@@ -317,13 +317,13 @@ x86 default/linux/x86/17.0/hardened/selinux stable
x86 default/linux/x86/17.0/desktop stable
x86 default/linux/x86/17.0/desktop/gnome stable
x86 default/linux/x86/17.0/desktop/gnome/systemd stable
-x86 default/linux/x86/17.0/desktop/gnome/systemd/merged-usr dev
+x86 default/linux/x86/17.0/desktop/gnome/systemd/merged-usr stable
x86 default/linux/x86/17.0/desktop/plasma stable
x86 default/linux/x86/17.0/desktop/plasma/systemd stable
-x86 default/linux/x86/17.0/desktop/plasma/systemd/merged-usr dev
+x86 default/linux/x86/17.0/desktop/plasma/systemd/merged-usr stable
x86 default/linux/x86/17.0/developer exp
x86 default/linux/x86/17.0/systemd stable
-x86 default/linux/x86/17.0/systemd/merged-usr dev
+x86 default/linux/x86/17.0/systemd/merged-usr stable
# musl profiles
# @MAINTAINER: musl@gentoo.org