From b53cbb7f624f6ee4076b5cbefcc09c9ad81ab373 Mon Sep 17 00:00:00 2001 From: "Marcus D. Hanwell" Date: Fri, 16 Sep 2005 18:34:54 +0000 Subject: [PATCH] Added the slot_rebuild function provided by Carsten Lohrke in bug 98425. --- eclass/kde.eclass | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/eclass/kde.eclass b/eclass/kde.eclass index bb92a6bd0c42..6a4ed9aaccd2 100644 --- a/eclass/kde.eclass +++ b/eclass/kde.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/kde.eclass,v 1.129 2005/08/27 09:35:18 flameeyes Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/kde.eclass,v 1.130 2005/09/16 18:34:54 cryos Exp $ # # Author Dan Armak # @@ -211,4 +211,43 @@ kde_src_install() { } +# slot rebuild function, thanks to Carsten Lohrke in bug 98425. +slot_rebuild() { + local VDB_PATH="$(portageq vdb_path)" + local KDE_PREFIX="$(kde-config --prefix)" + local REBUILD_LIST="" + + echo + einfo "Scan for possible needed slot related rebuilds.\n" + for i in ${*} ; do + local temp="$(ls -1d ${VDB_PATH}/${i}*)" + for j in ${temp} ; do + if [ $(cat $(grep -o /.*/lib.*\.la ${j}/CONTENTS) | grep -co "${KDE_PREFIX}") = 0 ] ; then + REBUILD_LIST="${REBUILD_LIST} =${j/${VDB_PATH}\//}" + fi + done + done + + if [ -n "${REBUILD_LIST}" ] ; then + local temp="" + cd ${VDB_PATH} + for i in ${REBUILD_LIST} ; do + i="$(echo ${i%-*} | cut -d= -f2)" + temp="${temp} $(find . -iname "DEPEND" -exec grep -H ${i} '{}' \; | cut -f2-3 -d/ | grep -v ${CATEGORY}/${PN})" + done + temp="$(echo ${temp} | fmt -w 1 | sort -u | fmt -w 10000)" + for i in ${temp} ; do + REBUILD_LIST="${REBUILD_LIST} =${i}" + done + fi + + if [ -n "${REBUILD_LIST}" ] ; then + einfo "Please run \"emerge --oneshot ${REBUILD_LIST}\" before continuing.\n" + else + einfo "Done :), continuing...\n" + return 1 + fi + echo +} + EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_install -- 2.26.2