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 406E71388BF for ; Wed, 17 Feb 2016 20:11:24 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id AC71621C00C; Wed, 17 Feb 2016 20:11:23 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 0CC8521C00C for ; Wed, 17 Feb 2016 20:11:23 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 0E3C6340D27 for ; Wed, 17 Feb 2016 20:11:21 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 683BD14AC for ; Wed, 17 Feb 2016 20:11:18 +0000 (UTC) From: "Mike Frysinger" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mike Frysinger" Message-ID: <1455739863.fc3a6a5fcb47813cc8e8d3a7998b1a31a4b7a491.vapier@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: sys-libs/libsemanage/ X-VCS-Repository: repo/gentoo X-VCS-Files: sys-libs/libsemanage/libsemanage-2.4-r2.ebuild sys-libs/libsemanage/libsemanage-9999.ebuild X-VCS-Directories: sys-libs/libsemanage/ X-VCS-Committer: vapier X-VCS-Committer-Name: Mike Frysinger X-VCS-Revision: fc3a6a5fcb47813cc8e8d3a7998b1a31a4b7a491 X-VCS-Branch: master Date: Wed, 17 Feb 2016 20:11:18 +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: 3d305cb3-ae20-485d-b1ce-eeb1d991af06 X-Archives-Hash: 63a15223c701cc58a4cf10dc0f7ced84 commit: fc3a6a5fcb47813cc8e8d3a7998b1a31a4b7a491 Author: Mike Frysinger gentoo org> AuthorDate: Wed Feb 17 19:45:14 2016 +0000 Commit: Mike Frysinger gentoo org> CommitDate: Wed Feb 17 20:11:03 2016 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fc3a6a5f sys-libs/libsemanage: improve ROOT handling in pkg_postinst Also ignore errors when /etc/selinux/config doesn't exist. sys-libs/libsemanage/libsemanage-2.4-r2.ebuild | 6 +++--- sys-libs/libsemanage/libsemanage-9999.ebuild | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sys-libs/libsemanage/libsemanage-2.4-r2.ebuild b/sys-libs/libsemanage/libsemanage-2.4-r2.ebuild index d43e13b..e2b0457 100644 --- a/sys-libs/libsemanage/libsemanage-2.4-r2.ebuild +++ b/sys-libs/libsemanage/libsemanage-2.4-r2.ebuild @@ -112,8 +112,8 @@ multilib_src_install() { pkg_postinst() { # Migrate the SELinux semanage configuration store if not done already - local selinuxtype=$(awk -F'=' '/SELINUXTYPE=/ {print $2}' /etc/selinux/config); - if [ -n "${selinuxtype}" ] && [ ! -d /var/lib/selinux/${mcs}/active ] ; then + local selinuxtype=$(awk -F'=' '/SELINUXTYPE=/ {print $2}' "${EROOT}"/etc/selinux/config 2>/dev/null) + if [ -n "${selinuxtype}" ] && [ ! -d "${EROOT}"/var/lib/selinux/${mcs}/active ] ; then ewarn "Since the 2.4 SELinux userspace, the policy module store is moved" ewarn "from /etc/selinux to /var/lib/selinux. The migration will be run now." ewarn "If there are any issues, it can be done manually by running:" @@ -124,7 +124,7 @@ pkg_postinst() { # Run the store migration without rebuilds for POLICY_TYPE in ${POLICY_TYPES} ; do - if [ ! -d "${ROOT}/var/lib/selinux/${POLICY_TYPE}/active" ] ; then + if [ ! -d "${EROOT}/var/lib/selinux/${POLICY_TYPE}/active" ] ; then einfo "Migrating store ${POLICY_TYPE} (without policy rebuild)." /usr/libexec/selinux/semanage_migrate_store -n -s "${POLICY_TYPE}" || die "Failed to migrate store ${POLICY_TYPE}" fi diff --git a/sys-libs/libsemanage/libsemanage-9999.ebuild b/sys-libs/libsemanage/libsemanage-9999.ebuild index 734b838..bb69814 100644 --- a/sys-libs/libsemanage/libsemanage-9999.ebuild +++ b/sys-libs/libsemanage/libsemanage-9999.ebuild @@ -118,8 +118,8 @@ multilib_src_install() { pkg_postinst() { # Migrate the SELinux semanage configuration store if not done already - local selinuxtype=$(awk -F'=' '/SELINUXTYPE=/ {print $2}' /etc/selinux/config); - if [ -n "${selinuxtype}" ] && [ ! -d /var/lib/selinux/${mcs}/active ] ; then + local selinuxtype=$(awk -F'=' '/SELINUXTYPE=/ {print $2}' "${EROOT}"/etc/selinux/config 2>/dev/null) + if [ -n "${selinuxtype}" ] && [ ! -d "${EROOT}"/var/lib/selinux/${mcs}/active ] ; then ewarn "Since the 2.4 SELinux userspace, the policy module store is moved" ewarn "from /etc/selinux to /var/lib/selinux. The migration will be run now." ewarn "If there are any issues, it can be done manually by running:" @@ -130,7 +130,7 @@ pkg_postinst() { # Run the store migration without rebuilds for POLICY_TYPE in ${POLICY_TYPES} ; do - if [ ! -d "${ROOT}/var/lib/selinux/${POLICY_TYPE}/active" ] ; then + if [ ! -d "${EROOT}/var/lib/selinux/${POLICY_TYPE}/active" ] ; then einfo "Migrating store ${POLICY_TYPE} (without policy rebuild)." /usr/libexec/selinux/semanage_migrate_store -n -s "${POLICY_TYPE}" || die "Failed to migrate store ${POLICY_TYPE}" fi