summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Armak <danarmak@gentoo.org>2005-01-14 22:43:22 +0000
committerDan Armak <danarmak@gentoo.org>2005-01-14 22:43:22 +0000
commit6abc1436bb5a94763a8bd64bcc8757bc9fc54c87 (patch)
treea5d7be815d0e8cdc3024a259155df07d82685b43 /eclass/kde-functions.eclass
parentStable ppc-macos. (Manifest recommit) (diff)
downloadgentoo-2-6abc1436bb5a94763a8bd64bcc8757bc9fc54c87.tar.gz
gentoo-2-6abc1436bb5a94763a8bd64bcc8757bc9fc54c87.tar.bz2
gentoo-2-6abc1436bb5a94763a8bd64bcc8757bc9fc54c87.zip
add two functions:
deprange-dual wraps deprange so that when adding a dep on a split package, the split package's parent monolithic package is accepted as an or-dep (though the split alternative comes first). get-current-package returns the full name, with category, of the current ebuild. maybe there's a standard way to do this but i've not found it.
Diffstat (limited to 'eclass/kde-functions.eclass')
-rw-r--r--eclass/kde-functions.eclass30
1 files changed, 29 insertions, 1 deletions
diff --git a/eclass/kde-functions.eclass b/eclass/kde-functions.eclass
index 11f8368d3dba..df75bde3e6ee 100644
--- a/eclass/kde-functions.eclass
+++ b/eclass/kde-functions.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-functions.eclass,v 1.82 2005/01/14 19:43:06 danarmak Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/kde-functions.eclass,v 1.83 2005/01/14 22:43:22 danarmak Exp $
#
# Author Dan Armak <danarmak@gentoo.org>
#
@@ -386,6 +386,18 @@ get-child-packages () {
done
}
+# Because I've no idea how to do it properly (fex how to get the category of the current ebuild),
+# this is a centralized function, and can be fixed centrally
+get-current-package () {
+ if [ -n "$KDEBASE" ]; then
+ echo -n kde-base/$PN
+ elif [ "$KMNAME" == "koffice" ]; then
+ echo -n app-office/$PN
+ else
+ die "get-current-parent-package() called from unrecognized ebuild $PN, please bugreport"
+ fi
+}
+
# convinience functions for requesting autotools versions
need-automake() {
@@ -624,6 +636,22 @@ deprange-iterate-suffixes() {
echo -n $NEWDEP
}
+# Wrapper around deprange() used for deps between split ebuilds.
+# It adds the parent monolithic ebuild of the dep as an alternative dep.
+deprange-dual() {
+ local MIN=$1 MAX=$2 NEWDEP=""
+ shift; shift
+ for PACKAGE in $@; do
+ PARENT=$(get-parent-package $PACKAGE)
+ NEWDEP="$NEWDEP || ( $(deprange-list $MIN $MAX $PACKAGE)"
+ if [ "$PARENT" != "$(get-parent-package $(get-current-package))" ]; then
+ NEWDEP="$NEWDEP $(deprange-list $MIN $MAX $PARENT)"
+ fi
+ NEWDEP="$NEWDEP )"
+ done
+ echo -n $NEWDEP
+}
+
# ---------------------------------------------------------------
# kde/qt directory management etc. functions, was kde-dirs.ebuild
# ---------------------------------------------------------------