summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app-portage/eix/eix-0.33.0-r1.ebuild8
-rw-r--r--eclass/tmpfiles.eclass30
-rw-r--r--eclass/toolchain-funcs.eclass10
-rw-r--r--sys-apps/opentmpfiles/opentmpfiles-0.1.3.ebuild4
-rw-r--r--sys-apps/opentmpfiles/opentmpfiles-9999.ebuild4
5 files changed, 38 insertions, 18 deletions
diff --git a/app-portage/eix/eix-0.33.0-r1.ebuild b/app-portage/eix/eix-0.33.0-r1.ebuild
index bd9217a151fd..f651221ce027 100644
--- a/app-portage/eix/eix-0.33.0-r1.ebuild
+++ b/app-portage/eix/eix-0.33.0-r1.ebuild
@@ -1,10 +1,10 @@
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=6
PLOCALES="de ru"
-inherit autotools bash-completion-r1 l10n systemd flag-o-matic
+inherit autotools bash-completion-r1 flag-o-matic l10n tmpfiles
DESCRIPTION="Search and query ebuilds"
HOMEPAGE="https://github.com/vaeth/eix/"
@@ -83,7 +83,7 @@ src_configure() {
src_install() {
default
dobashcomp bash/eix
- systemd_dotmpfilesd tmpfiles.d/eix.conf
+ dotmpfiles tmpfiles.d/eix.conf
rm -r "${ED%/}"/usr/bin/eix-functions.sh || die
@@ -94,7 +94,7 @@ pkg_postinst() {
if ! use prefix; then
# note: if this is done in src_install(), portage:portage
# ownership may be reset to root
- chown portage:portage "${EROOT%/}"/var/cache/eix || die
+ tmpfiles_process eix.conf
fi
local obs=${EROOT%/}/var/cache/eix.previous
diff --git a/eclass/tmpfiles.eclass b/eclass/tmpfiles.eclass
index 2a158c482a58..6a461d4df859 100644
--- a/eclass/tmpfiles.eclass
+++ b/eclass/tmpfiles.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2016 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: tmpfiles.eclass
@@ -17,10 +17,16 @@
# https://www.freedesktop.org/software/systemd/man/tmpfiles.d.html
#
# The dotmpfiles and newtmpfiles functions are used to install
-# configuration files into /usr/lib/tmpfiles.d, then in pkg_postinst, the
-# tmpfiles_process function can be called to process the newly
+# configuration files into /usr/lib/tmpfiles.d, then in pkg_postinst,
+# the tmpfiles_process function must be called to process the newly
# installed tmpfiles.d entries.
#
+# The tmpfiles.d files can be used by service managers to recreate/clean
+# up temporary directories on boot or periodically. Additionally,
+# the pkg_postinst() call ensures that the directories are created
+# on systems that do not support tmpfiles.d natively, without a need
+# for explicit fallback.
+#
# @EXAMPLE:
# Typical usage of this eclass:
#
@@ -53,7 +59,7 @@ case "${EAPI}" in
*) die "API is undefined for EAPI ${EAPI}" ;;
esac
-RDEPEND="kernel_linux? ( virtual/tmpfiles )"
+RDEPEND="virtual/tmpfiles"
# @FUNCTION: dotmpfiles
# @USAGE: dotmpfiles <tmpfiles.d_file> ...
@@ -62,7 +68,6 @@ RDEPEND="kernel_linux? ( virtual/tmpfiles )"
dotmpfiles() {
debug-print-function "${FUNCNAME}" "$@"
- use kernel_linux || return 0
local f
for f; do
if [[ ${f} != *.conf ]]; then
@@ -83,7 +88,6 @@ dotmpfiles() {
newtmpfiles() {
debug-print-function "${FUNCNAME}" "$@"
- use kernel_linux || return 0
if [[ $2 != *.conf ]]; then
die "tmpfiles.d files must end with .conf"
fi
@@ -102,12 +106,22 @@ newtmpfiles() {
tmpfiles_process() {
debug-print-function "${FUNCNAME}" "$@"
- use kernel_linux || return 0
[[ ${EBUILD_PHASE} == postinst ]] || die "${FUNCNAME}: Only valid in pkg_postinst"
[[ ${#} -gt 0 ]] || die "${FUNCNAME}: Must specify at least one filename"
# Only process tmpfiles for the currently running system
- [[ ${ROOT} == / ]] || return 0
+ if [[ ${ROOT} != / ]]; then
+ ewarn "Warning: tmpfiles.d not processed on ROOT != /. If you do not use"
+ ewarn "a service manager supporting tmpfiles.d, you need to run"
+ ewarn "the following command after booting (or chroot-ing with all"
+ ewarn "appropriate filesystems mounted) into the ROOT:"
+ ewarn
+ ewarn " tmpfiles --create"
+ ewarn
+ ewarn "Failure to do so may result in missing runtime directories"
+ ewarn "and failures to run programs or start services."
+ return
+ fi
if type systemd-tmpfiles &> /dev/null; then
systemd-tmpfiles --create "$@"
diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass
index aeb6f7c70299..4b1876b8e09b 100644
--- a/eclass/toolchain-funcs.eclass
+++ b/eclass/toolchain-funcs.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: toolchain-funcs.eclass
@@ -40,7 +40,13 @@ _tc-getPROG() {
export ${var}="${prog[*]}"
echo "${!var}"
}
-tc-getBUILD_PROG() { _tc-getPROG CBUILD "BUILD_$1 $1_FOR_BUILD HOST$1" "${@:2}"; }
+tc-getBUILD_PROG() {
+ local vars="BUILD_$1 $1_FOR_BUILD HOST$1"
+ # respect host vars if not cross-compiling
+ # https://bugs.gentoo.org/630282
+ tc-is-cross-compiler || vars+=" $1"
+ _tc-getPROG CBUILD "${vars}" "${@:2}"
+}
tc-getPROG() { _tc-getPROG CHOST "$@"; }
# @FUNCTION: tc-getAR
diff --git a/sys-apps/opentmpfiles/opentmpfiles-0.1.3.ebuild b/sys-apps/opentmpfiles/opentmpfiles-0.1.3.ebuild
index bb0ba6227193..6542ddfd45d9 100644
--- a/sys-apps/opentmpfiles/opentmpfiles-0.1.3.ebuild
+++ b/sys-apps/opentmpfiles/opentmpfiles-0.1.3.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=6
@@ -9,7 +9,7 @@ if [[ ${PV} = 9999* ]]; then
else
SRC_URI="https://github.com/openrc/${PN}/archive/${PV}.tar.gz ->
${P}.tar.gz"
- KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86"
+ KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~x86-fbsd"
fi
DESCRIPTION="A standalone utility to process systemd-style tmpfiles.d files"
diff --git a/sys-apps/opentmpfiles/opentmpfiles-9999.ebuild b/sys-apps/opentmpfiles/opentmpfiles-9999.ebuild
index c96bac4a3db0..1577a7364fc9 100644
--- a/sys-apps/opentmpfiles/opentmpfiles-9999.ebuild
+++ b/sys-apps/opentmpfiles/opentmpfiles-9999.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=6
@@ -9,7 +9,7 @@ if [[ ${PV} = 9999* ]]; then
else
SRC_URI="https://github.com/openrc/${PN}/archive/${PV}.tar.gz ->
${P}.tar.gz"
- KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd"
fi
DESCRIPTION="A standalone utility to process systemd-style tmpfiles.d files"