From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 9F5C41381F3 for ; Tue, 22 Oct 2013 15:14:43 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3D2BDE08E0; Tue, 22 Oct 2013 15:14:43 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id BC9D2E08E0 for ; Tue, 22 Oct 2013 15:14:42 +0000 (UTC) Received: from flycatcher.gentoo.org (flycatcher.gentoo.org [81.93.255.6]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id A8DC333F0E0 for ; Tue, 22 Oct 2013 15:14:41 +0000 (UTC) Received: by flycatcher.gentoo.org (Postfix, from userid 2279) id 5D0042004C; Tue, 22 Oct 2013 15:14:40 +0000 (UTC) From: "Michal Gorny (mgorny)" To: gentoo-commits@lists.gentoo.org Reply-To: gentoo-dev@lists.gentoo.org, mgorny@gentoo.org Subject: [gentoo-commits] gentoo-x86 commit in eclass: ChangeLog systemd.eclass X-VCS-Repository: gentoo-x86 X-VCS-Files: ChangeLog systemd.eclass X-VCS-Directories: eclass X-VCS-Committer: mgorny X-VCS-Committer-Name: Michal Gorny Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Message-Id: <20131022151440.5D0042004C@flycatcher.gentoo.org> Date: Tue, 22 Oct 2013 15:14:40 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 8fe0c09a-6b9f-40b2-8d13-e34acf304bf7 X-Archives-Hash: 26aed102bb0d1a95caa69286d320e4d2 mgorny 13/10/22 15:14:40 Modified: ChangeLog systemd.eclass Log: Add systemd_enable_ntpunit wrt bug #458132. Revision Changes Path 1.1030 eclass/ChangeLog file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.1030&view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.1030&content-type=text/plain diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?r1=1.1029&r2=1.1030 Index: ChangeLog =================================================================== RCS file: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v retrieving revision 1.1029 retrieving revision 1.1030 diff -u -r1.1029 -r1.1030 --- ChangeLog 20 Oct 2013 21:45:31 -0000 1.1029 +++ ChangeLog 22 Oct 2013 15:14:40 -0000 1.1030 @@ -1,6 +1,9 @@ # ChangeLog for eclass directory # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1029 2013/10/20 21:45:31 pesa Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1030 2013/10/22 15:14:40 mgorny Exp $ + + 22 Oct 2013; Michał Górny systemd.eclass: + Add systemd_enable_ntpunit wrt bug #458132. 20 Oct 2013; Davide Pesavento qt4-build.eclass: Updates from qt overlay: drop USE="c++0x" from 4.8.5 and later versions; warn 1.31 eclass/systemd.eclass file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/systemd.eclass?rev=1.31&view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/systemd.eclass?rev=1.31&content-type=text/plain diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/systemd.eclass?r1=1.30&r2=1.31 Index: systemd.eclass =================================================================== RCS file: /var/cvsroot/gentoo-x86/eclass/systemd.eclass,v retrieving revision 1.30 retrieving revision 1.31 diff -u -r1.30 -r1.31 --- systemd.eclass 12 Sep 2013 11:46:41 -0000 1.30 +++ systemd.eclass 22 Oct 2013 15:14:40 -0000 1.31 @@ -1,6 +1,6 @@ # Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/systemd.eclass,v 1.30 2013/09/12 11:46:41 mgorny Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/systemd.eclass,v 1.31 2013/10/22 15:14:40 mgorny Exp $ # @ECLASS: systemd.eclass # @MAINTAINER: @@ -218,6 +218,53 @@ dosym ../"${service}" "${ud}"/"${target}".wants/"${destname}" } +# @FUNCTION: systemd_enable_ntpunit +# @USAGE: ... +# @DESCRIPTION: +# Add an NTP service provider to the list of implementations +# in timedated. defines the newly-created ntp-units.d priority +# and name, while the remaining arguments list service units that will +# be added to that file. +# +# Uses doins, thus it is fatal in EAPI 4 and non-fatal in earlier +# EAPIs. +# +# Doc: http://www.freedesktop.org/wiki/Software/systemd/timedated/ +systemd_enable_ntpunit() { + debug-print-function ${FUNCNAME} "${@}" + if [[ ${#} -lt 2 ]]; then + die "Usage: systemd_enable_ntpunit ..." + fi + + local ntpunit_name=${1} + local services=( "${@:2}" ) + + if [[ ${ntpunit_name} != [0-9][0-9]-* ]]; then + die "ntpunit.d file must be named NN-name where NN are digits." + elif [[ ${ntpunit_name} == *.list ]]; then + die "The .list suffix is appended implicitly to ntpunit.d name." + fi + + local unitdir=$(systemd_get_unitdir) + local s + for s in "${services[@]}"; do + if [[ ! -f "${D}${unitdir}/${s}" ]]; then + die "ntp-units.d provider ${s} not installed (yet?) in \${D}." + fi + echo "${s}" >> "${T}"/${ntpunit_name}.list + done + + ( + insinto "$(_systemd_get_utildir)"/ntp-units.d + doins "${T}"/${ntpunit_name}.list + ) + local ret=${?} + + rm "${T}"/${ntpunit_name}.list || die + + return ${ret} +} + # @FUNCTION: systemd_with_unitdir # @USAGE: [] # @DESCRIPTION: