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 2F8FC138334 for ; Wed, 3 Oct 2018 13:14:14 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 0B7B7E0A85; Wed, 3 Oct 2018 13:14:10 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (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 AB470E08E8 for ; Wed, 3 Oct 2018 13:14:09 +0000 (UTC) Received: from naomi.gilbertsystems.net (d192-24-229-26.try.wideopenwest.com [24.192.26.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: floppym) by smtp.gentoo.org (Postfix) with ESMTPSA id 48817335C9F; Wed, 3 Oct 2018 13:14:07 +0000 (UTC) From: Mike Gilbert To: gentoo-dev@lists.gentoo.org Cc: freedesktop-bugs@gentoo.org Subject: [gentoo-dev] [PATCH] xdg-utils.eclass: execute tools from PATH Date: Wed, 3 Oct 2018 09:14:04 -0400 Message-Id: <20181003131404.3397-1-floppym@gentoo.org> X-Mailer: git-send-email 2.19.0 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 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Archives-Salt: a671b073-a5a5-49a1-82d0-4a38ec8146fc X-Archives-Hash: 700dc49949126506c1f92b1d2ade72ae Avoid calling binaries that may have been compiled against different libraries or even cross-compiled for an incomatible arch. Also drop the related eclass variables: these are currently unused by any ebuild. Signed-off-by: Mike Gilbert --- eclass/xdg-utils.eclass | 28 ++++++---------------------- 1 file changed, 6 insertions(+), 22 deletions(-) diff --git a/eclass/xdg-utils.eclass b/eclass/xdg-utils.eclass index fe1eef213ea4..d46fe9b80759 100644 --- a/eclass/xdg-utils.eclass +++ b/eclass/xdg-utils.eclass @@ -20,24 +20,12 @@ case "${EAPI:-0}" in *) die "EAPI=${EAPI} is not supported" ;; esac -# @ECLASS-VARIABLE: DESKTOP_DATABASE_UPDATE_BIN -# @INTERNAL -# @DESCRIPTION: -# Path to update-desktop-database -: ${DESKTOP_DATABASE_UPDATE_BIN:="/usr/bin/update-desktop-database"} - # @ECLASS-VARIABLE: DESKTOP_DATABASE_DIR # @INTERNAL # @DESCRIPTION: # Directory where .desktop files database is stored : ${DESKTOP_DATABASE_DIR="/usr/share/applications"} -# @ECLASS-VARIABLE: MIMEINFO_DATABASE_UPDATE_BIN -# @INTERNAL -# @DESCRIPTION: -# Path to update-mime-database -: ${MIMEINFO_DATABASE_UPDATE_BIN:="/usr/bin/update-mime-database"} - # @ECLASS-VARIABLE: MIMEINFO_DATABASE_DIR # @INTERNAL # @DESCRIPTION: @@ -67,19 +55,17 @@ 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}" - if [[ ${EBUILD_PHASE} != post* ]] ; then die "xdg_desktop_database_update must be used in pkg_post* phases." fi - if [[ ! -x "${updater}" ]] ; then - debug-print "${updater} is not executable" + if ! type update-desktop-database &>/dev/null ; then + debug-print "update-desktop-database is not found" return fi ebegin "Updating .desktop files database" - "${updater}" -q "${EROOT%/}${DESKTOP_DATABASE_DIR}" + update-desktop-database -q "${EROOT%/}${DESKTOP_DATABASE_DIR}" eend $? } @@ -88,18 +74,16 @@ xdg_desktop_database_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}" - if [[ ${EBUILD_PHASE} != post* ]] ; then die "xdg_mimeinfo_database_update must be used in pkg_post* phases." fi - if [[ ! -x "${updater}" ]] ; then - debug-print "${updater} is not executable" + if ! type update-mime-database &>/dev/null ; then + debug-print "update-mime-database is not found" return fi ebegin "Updating shared mime info database" - "${updater}" "${EROOT%/}${MIMEINFO_DATABASE_DIR}" + update-mime-database "${EROOT%/}${MIMEINFO_DATABASE_DIR}" eend $? } -- 2.19.0