Merge pull request #257 from flatcar-linux/krnowak/tmpfiles

Sync tmpfiles things with gentoo
This commit is contained in:
Krzesimir Nowak 2021-12-17 09:59:44 +01:00 committed by GitHub
commit 5daae3252e
7 changed files with 39 additions and 1578 deletions

View File

@ -2,9 +2,7 @@
# Distributed under the terms of the GNU General Public License v2 # Distributed under the terms of the GNU General Public License v2
# Flatcar: this file is modified to still support old EAPIs and to # Flatcar: this file is modified to still support old EAPIs.
# still provide the deprecated systemd_dotmpfilesd and
# systemd_newtmpfilesd functions.
# @ECLASS: systemd.eclass # @ECLASS: systemd.eclass
@ -263,48 +261,6 @@ systemd_install_serviced() {
) )
} }
# @FUNCTION: systemd_dotmpfilesd
# @USAGE: <tmpfilesd>...
# @DESCRIPTION:
# Deprecated in favor of tmpfiles.eclass.
#
# Install systemd tmpfiles.d files. Uses doins, thus it is fatal
# in EAPI 4 and non-fatal in earlier EAPIs.
systemd_dotmpfilesd() {
debug-print-function ${FUNCNAME} "${@}"
for f; do
[[ ${f} == *.conf ]] \
|| die 'tmpfiles.d files need to have .conf suffix.'
done
(
insopts -m 0644
insinto /usr/lib/tmpfiles.d/
doins "${@}"
)
}
# @FUNCTION: systemd_newtmpfilesd
# @USAGE: <old-name> <new-name>.conf
# @DESCRIPTION:
# Deprecated in favor of tmpfiles.eclass.
#
# Install systemd tmpfiles.d file under a new name. Uses newins, thus it
# is fatal in EAPI 4 and non-fatal in earlier EAPIs.
systemd_newtmpfilesd() {
debug-print-function ${FUNCNAME} "${@}"
[[ ${2} == *.conf ]] \
|| die 'tmpfiles.d files need to have .conf suffix.'
(
insopts -m 0644
insinto /usr/lib/tmpfiles.d/
newins "${@}"
)
}
# @FUNCTION: systemd_enable_service # @FUNCTION: systemd_enable_service
# @USAGE: <target> <service> # @USAGE: <target> <service>
# @DESCRIPTION: # @DESCRIPTION:

View File

@ -1,4 +1,4 @@
# Copyright 2016-2019 Gentoo Authors # Copyright 2016-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2 # Distributed under the terms of the GNU General Public License v2
# @ECLASS: tmpfiles.eclass # @ECLASS: tmpfiles.eclass
@ -60,10 +60,19 @@ case "${EAPI}" in
*) die "API is undefined for EAPI ${EAPI}" ;; *) die "API is undefined for EAPI ${EAPI}" ;;
esac esac
RDEPEND="virtual/tmpfiles" # @ECLASS-VARIABLE: TMPFILES_OPTIONAL
# @PRE_INHERIT
# @DEFAULT_UNSET
# @DESCRIPTION:
# When not empty, disables the dependency on virtual/tmpfiles.
# Ebuilds that call tmpfiles_process conditionally should declare a
# conditional dependency themselves.
if [[ -z ${TMPFILES_OPTIONAL} ]]; then
RDEPEND="virtual/tmpfiles"
fi
# @FUNCTION: dotmpfiles # @FUNCTION: dotmpfiles
# @USAGE: dotmpfiles <tmpfiles.d_file> ... # @USAGE: <tmpfiles.d_file> ...
# @DESCRIPTION: # @DESCRIPTION:
# Install one or more tmpfiles.d files into /usr/lib/tmpfiles.d. # Install one or more tmpfiles.d files into /usr/lib/tmpfiles.d.
dotmpfiles() { dotmpfiles() {
@ -84,7 +93,7 @@ dotmpfiles() {
} }
# @FUNCTION: newtmpfiles # @FUNCTION: newtmpfiles
# @USAGE: newtmpfiles <old-name> <new-name>.conf # @USAGE: <old-name> <new-name>.conf
# @DESCRIPTION: # @DESCRIPTION:
# Install a tmpfiles.d file in /usr/lib/tmpfiles.d under a new name. # Install a tmpfiles.d file in /usr/lib/tmpfiles.d under a new name.
newtmpfiles() { newtmpfiles() {
@ -102,7 +111,7 @@ newtmpfiles() {
} }
# @FUNCTION: tmpfiles_process # @FUNCTION: tmpfiles_process
# @USAGE: tmpfiles_process <filename> <filename> ... # @USAGE: <filename> <filename> ...
# @DESCRIPTION: # @DESCRIPTION:
# Call a tmpfiles.d implementation to create new volatile and temporary # Call a tmpfiles.d implementation to create new volatile and temporary
# files and directories. # files and directories.

File diff suppressed because it is too large Load Diff

View File

@ -2,8 +2,7 @@
# Distributed under the terms of the GNU General Public License v2 # Distributed under the terms of the GNU General Public License v2
# Flatcar: this file is modified to still support old EAPIs and to # Flatcar: this file is modified to still support old EAPIs.
# still provide the deprecated systemd_dotmpfilesd functions.
# @ECLASS: udev.eclass # @ECLASS: udev.eclass

View File

@ -1,8 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> <!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata> <pkgmetadata>
<maintainer type="person"> <maintainer type="person">
<email>williamh@gentoo.org</email> <email>williamh@gentoo.org</email>
<name>William Hubbs</name> <name>William Hubbs</name>
</maintainer> </maintainer>
<maintainer type="person">
<email>gyakovlev@gentoo.org</email>
<name>Georgy Yakovlev</name>
</maintainer>
<stabilize-allarches/>
</pkgmetadata> </pkgmetadata>

View File

@ -0,0 +1,17 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
DESCRIPTION="Virtual to select between different tmpfiles.d handlers"
SLOT="0"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
RDEPEND="
!prefix-guest? (
|| (
sys-apps/systemd-tmpfiles
sys-apps/opentmpfiles
sys-apps/systemd
)
)"

View File

@ -1,14 +0,0 @@
# Copyright 1999-2018 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
DESCRIPTION="Virtual to select between different tmpfiles.d handlers"
SLOT="0"
KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
RDEPEND="
|| (
sys-apps/opentmpfiles
sys-apps/systemd
)"