From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 8300F138334 for ; Wed, 27 Jun 2018 01:30:03 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 2092CE09CC; Wed, 27 Jun 2018 01:28:46 +0000 (UTC) Received: from mx-out1.startmail.com (mx-out1.startmail.com [145.131.90.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 7EB9EE09A2 for ; Wed, 27 Jun 2018 01:28:45 +0000 (UTC) From: "Marty E. Plummer" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=startmail.com; s=2017-11; t=1530062924; bh=8f19htHbF9I9e6tGqoa1WEzDZtpbCNRadVYRc9IqLNg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eZvtCa0eHc/wkw6/xNpGmQSZy0qJuDrhFtbnIO+GybF8GWq33NB0KneOPZ2O4vOB3 W6hoi0VsTmwKYZ3L6vafcuEEtLGn/l0lchq/ZsMEEA5HymwIS8GZWNQlR0KM0w9tFU EBtVMX9VycuIdYlekZtbCCM1qCqn+GxGDlOHp216u+46pJNtk4KRlfWFCbtok1OlEO sGfODF3lc68rIpues1GiZGuH6TFEXj0IJkclBsAtAsI4Q7ypPWQnSVDXbGRmpiveT1 bcZ1d0NhFgX/euvUSZGQXB22R/gcEvBM28jhIduostFLPAwEzjvRcGCjLs3Ss3BLD5 88QeVSxGxrpNw== To: gentoo-dev@lists.gentoo.org Cc: "Marty E. Plummer" Subject: [gentoo-dev] [PATCH 03/10] xdg-utils.eclass: make EAPI 7 ready Date: Tue, 26 Jun 2018 20:27:27 -0500 Message-Id: <20180627012734.1319-4-hanetzer@startmail.com> In-Reply-To: <20180627012734.1319-1-hanetzer@startmail.com> References: <20180627012734.1319-1-hanetzer@startmail.com> 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: 5e83b89c-1601-4a7f-b806-522f2c0b8233 X-Archives-Hash: 60dd6f58ede0640a2a77fd4270a02bd7 Use ${EROOT%/} whereever possible, as the tools and directories which are used with it are already prefixed with a / Use BROOT to specify path to update-mime-database and friends, setting that to EROOT when not EAPI 7 Package-Manager: Portage-2.3.40, Repoman-2.3.9 --- eclass/xdg-utils.eclass | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/eclass/xdg-utils.eclass b/eclass/xdg-utils.eclass index f9088d9c348..9e4d4638e38 100644 --- a/eclass/xdg-utils.eclass +++ b/eclass/xdg-utils.eclass @@ -72,7 +72,8 @@ xdg_environment_reset() { # Updates the .desktop files database. # Generates a list of mimetypes linked to applications that can handle them xdg_desktop_database_update() { - local updater="${EROOT}${DESKTOP_DATABASE_UPDATE_BIN}" + [[ ${EAPI:-0} == [0123456] ]] && BROOT=${EROOT} + local updater="${BROOT%/}${DESKTOP_DATABASE_UPDATE_BIN}" if [[ ${EBUILD_PHASE} != post* ]] ; then die "xdg_desktop_database_update must be used in pkg_post* phases." @@ -84,7 +85,7 @@ xdg_desktop_database_update() { fi ebegin "Updating .desktop files database" - "${updater}" -q "${EROOT}${DESKTOP_DATABASE_DIR}" + "${updater}" -q "${EROOT%/}${DESKTOP_DATABASE_DIR}" eend $? } @@ -93,8 +94,8 @@ xdg_desktop_database_update() { # Updates Gtk+ icon cache files under /usr/share/icons. # This function should be called from pkg_postinst and pkg_postrm. xdg_icon_cache_update() { - has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}" - local updater="${EROOT%/}${GTK_UPDATE_ICON_CACHE}" + [[ ${EAPI:-0} == [0123456] ]] && BROOT=${EROOT} + local updater="${BROOT%/}${GTK_UPDATE_ICON_CACHE}" if [[ ! -x "${updater}" ]]; then debug-print "${updater} is not executable" @@ -145,7 +146,8 @@ xdg_icon_cache_update() { # Update the mime database. # Creates a general list of mime types from several sources xdg_mimeinfo_database_update() { - local updater="${EROOT}${MIMEINFO_DATABASE_UPDATE_BIN}" + [[ ${EAPI:-0} == [0123456] ]] && BROOT=${EROOT} + local updater="${BROOT%/}${MIMEINFO_DATABASE_UPDATE_BIN}" if [[ ${EBUILD_PHASE} != post* ]] ; then die "xdg_mimeinfo_database_update must be used in pkg_post* phases." @@ -157,6 +159,6 @@ xdg_mimeinfo_database_update() { fi ebegin "Updating shared mime info database" - "${updater}" "${EROOT}${MIMEINFO_DATABASE_DIR}" + "${updater}" "${EROOT%/}${MIMEINFO_DATABASE_DIR}" eend $? } -- 2.17.1