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 5B2321381F3 for ; Wed, 24 Jul 2013 07:18:21 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A0CADE09ED; Wed, 24 Jul 2013 07:18:12 +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 D8658E0980 for ; Wed, 24 Jul 2013 07:18:11 +0000 (UTC) Received: from pomiot.lan (213-238-102-188.adsl.inetia.pl [213.238.102.188]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: mgorny) by smtp.gentoo.org (Postfix) with ESMTPSA id 1952733E753; Wed, 24 Jul 2013 07:18:09 +0000 (UTC) From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= To: gentoo-dev@lists.gentoo.org Cc: systemd@gentoo.org, =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Subject: [gentoo-dev] [PATCH systemd.eclass] Introduce systemd_is_booted(). Date: Wed, 24 Jul 2013 09:18:13 +0200 Message-Id: <1374650293-21212-1-git-send-email-mgorny@gentoo.org> X-Mailer: git-send-email 1.8.3.2 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Archives-Salt: 90ea9b79-4774-4103-9b1a-172b00e428ab X-Archives-Hash: cc4b807e07060a67f08691710016f7f9 Pacho requested that to be able to warn users in GNOME packages that do not work anymore without systemd. --- gx86/eclass/systemd.eclass | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/gx86/eclass/systemd.eclass b/gx86/eclass/systemd.eclass index 166c7be..a2750d7 100644 --- a/gx86/eclass/systemd.eclass +++ b/gx86/eclass/systemd.eclass @@ -252,3 +252,20 @@ systemd_update_catalog() { debug-print "${FUNCNAME}: journalctl not found." fi } + +# @FUNCTION: systemd_is_booted +# @DESCRIPTION: +# Check whether the system was booted using systemd. +# +# Returns 0 if systemd is used to boot the system, 1 otherwise. +# +# See: man sd_booted +systemd_update_catalog() { + debug-print-function ${FUNCNAME} "${@}" + + [[ -d /run/systemd/system ]] + local ret=${?} + + debug-print "${FUNCNAME}: [[ -d /run/systemd/system ]] -> ${ret}" + return ${ret} +} -- 1.8.3.2