summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetr Morávek [Xificurk] <xificurk@gmail.com>2009-11-03 17:03:14 +0100
committerPetr Morávek [Xificurk] <xificurk@gmail.com>2009-11-03 17:06:59 +0100
commitb699a0af98c30da94ea58eb5faebadb977e2fcb3 (patch)
tree3d00bae6d27cb1b8477d7f480f986939c9bcac32 /eclass/kde-functions.eclass
parentadd digikam and deps from portage tree (diff)
downloadkde-sunset-b699a0af98c30da94ea58eb5faebadb977e2fcb3.tar.gz
kde-sunset-b699a0af98c30da94ea58eb5faebadb977e2fcb3.tar.bz2
kde-sunset-b699a0af98c30da94ea58eb5faebadb977e2fcb3.zip
Sync eclasses
Diffstat (limited to 'eclass/kde-functions.eclass')
-rw-r--r--eclass/kde-functions.eclass266
1 files changed, 3 insertions, 263 deletions
diff --git a/eclass/kde-functions.eclass b/eclass/kde-functions.eclass
index 30998003..c735c144 100644
--- a/eclass/kde-functions.eclass
+++ b/eclass/kde-functions.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/kde-functions.eclass,v 1.173 2009/05/13 21:00:42 scarabeus Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/kde-functions.eclass,v 1.175 2009/11/01 20:26:34 abcd Exp $
# @ECLASS: kde-functions.eclass
# @MAINTAINER:
@@ -365,257 +365,6 @@ EOF
return 1
}
-# @FUNCTION: deprange
-# @USAGE: < minver > < maxver > < package > [...]
-# @DESCRIPTION:
-# For minver, a -rN part is supported. For both minver and maxver, _alpha/beta/pre/rc suffixes
-# are supported, but not _p suffixes or teminating letters (eg 3.3.1a).
-#
-# This function echoes a string of the form (for package="kde-base/kdelibs")
-# || ( =kde-base/kdelibs-3.3.1-r1 ~kde-base/kdelibs-3.3.2 ~kde-base/kdelibs-3.3.3 )
-# This dep means versions of package from maxver through minver will be acceptable.
-# Note that only the kde versioning scheme is supported - ie x.y, and we only iterate through y
-# (i.e. x can contain more . separators).
-deprange() {
- local list="$(deprange-list $@)"
- if [[ ${list%% *} == "${list}" ]]; then
- echo "${list}"
- else
- echo "|| ( ${list} )"
- fi
-}
-
-deprange-list() {
- # Assign, parse params
- local MINVER=$1; shift
- local MAXVER=$1; shift
-
- # Workaround for 3.5.0_beta1 ebuilds being mistakenly versioned as 3.5_beta1
- # Ugly kludge, but will disappear once 3.5 prerelease ebuilds are removed from portage
- if [[ "$MINVER" == "3.5_beta1" ]]; then
-
- MINVER="3.5.0_beta1"
- FINALOPTIONVER="3.5_beta1"
- fi
- if [[ "$MAXVER" == "3.5_beta1" ]]; then
- MAXVER="3.5.0_beta1"
- fi
-
- # Get base version - the major X.Y components
- local BASEVER=${MINVER%.*}
- if [[ "${MAXVER%.*}" != "$BASEVER" ]]; then
- die "deprange(): unsupported parameters $MINVER $MAXVER - BASEVER must be identical"
- fi
-
- # Get version suffixes
- local MINSUFFIX MAXSUFFIX
- if [[ "$MINVER" != "${MINVER/_}" ]]; then
- MINSUFFIX=${MINVER##*_}
- SUFFIXLESSMINVER=${MINVER%_*}
- else
- SUFFIXLESSMINVER=$MINVER
- fi
- if [[ "$MAXVER" != "${MAXVER/_}" ]]; then
- MAXSUFFIX=${MAXVER##*_}
- SUFFIXLESSMAXVER=${MAXVER%_*}
- else
- SUFFIXLESSMAXVER=$MAXVER
- fi
-
- # Separate out the optional lower bound revision number
- if [[ "$MINVER" != "${MINVER/-}" ]]; then
- local MINREV=${MINVER##*-}
- fi
-
- # Get minor version components (the 1 in 3.3.1)
- local MINMINOR=${SUFFIXLESSMINVER##*.}
- local MAXMINOR=${SUFFIXLESSMAXVER##*.}
-
- # Iterate over packages
- while [[ -n "$1" ]]; do
- local PACKAGE=$1
- shift
-
- local NEWDEP=""
-
- # If the two versions are identical, our job is simple
- if [[ "$MINVER" == "$MAXVER" ]]; then
- NEWDEP="~$PACKAGE-$MINVER"
-
- # If the range bounds differ only by their suffixes
- elif [[ "$MINMINOR" == "$MAXMINOR" ]]; then
- NEWDEP="$(deprange-iterate-suffixes "~$PACKAGE-$BASEVER.$MINMINOR" $MINSUFFIX $MAXSUFFIX)"
-
- # Revision constraint on lower bound
- if [[ -n "$MINREV" ]]; then
- NEWDEP="$NEWDEP
- $(deprange-iterate-numbers "=$PACKAGE-$BASEVER.${MINMINOR}_$MINSUFFIX-r" $MINREV 50)"
- fi
-
- # If the minor version numbers are different too
- else
- # Max version's allowed suffixes
- if [[ -n "$MAXSUFFIX" ]]; then
- NEWDEP="$(deprange-iterate-suffixes "~$PACKAGE-$BASEVER.$MAXMINOR" alpha1 $MAXSUFFIX)"
- fi
-
- STARTMINOR="${MINMINOR}"
-
- # regular versions in between
- if [[ -n "$MINREV" ]] && [[ -z "$MINSUFFIX" ]]; then
- let STARTMINOR++
- fi
- NEWDEP="$NEWDEP
- $(deprange-iterate-numbers "~${PACKAGE}-${BASEVER}." $STARTMINOR $MAXMINOR)"
-
- # Min version's allowed suffixes
- if [[ -n "$MINSUFFIX" ]]; then
- NEWDEP="$NEWDEP
- $(deprange-iterate-suffixes "~$PACKAGE-$BASEVER.$MINMINOR" $MINSUFFIX rc10)"
- fi
- if [[ -n "$MINREV" ]]; then
- local BASE
- if [[ -n "$MINSUFFIX" ]]; then
- BASE="=$PACKAGE-$BASEVER.${MINMINOR}_${MINSUFFIX%-r*}-r"
- else
- BASE="=$PACKAGE-$BASEVER.${MINMINOR%-r*}-r"
- fi
- NEWDEP="$NEWDEP
- $(deprange-iterate-numbers $BASE ${MINREV#r} 50)"
- fi
- fi
-
- # second part of kludge
- if [[ -n "$FINALOPTIONVER" ]]; then
- NEWDEP="$NEWDEP ~$PACKAGE-$FINALOPTIONVER"
- fi
-
- # Output
- echo -n $NEWDEP
- done
-}
-
-# This internal function iterates over simple ranges where only a numerical suffix changes
-# Parameters: base name, lower bound, upper bound
-deprange-iterate-numbers() {
- local package=$1 lower=$2 upper=$3 i newdep=""
- for (( i=$upper ; $i >= $lower ; i-- )) ; do
- newdep="$newdep ${package}${i}"
- done
- echo -n $newdep
-}
-
-# This internal function iterates over ranges with the same base version and different suffixes.
-# If the lower bound has a revision number, this function won't mention the lower bound in its output.
-# Parameters: base name, lower version suffix, upper version suffix
-# eg: deprange-iterate-suffixes ~kde-base/libkonq-3.4.0 alpha8 beta2
-deprange-iterate-suffixes() {
- local NAME=$1 MINSUFFIX=$2 MAXSUFFIX=$3
-
- # Separate out the optional lower bound revision number
- if [[ "$MINSUFFIX" != "${MINSUFFIX/-}" ]]; then
- local MINREV=${MINSUFFIX##*-}
- fi
- MINSUFFIX=${MINSUFFIX%-*}
-
- # Separate out the version suffixes
- local MINalpha MINbeta MINpre MINrc
- if [[ "$MINSUFFIX" != "${MINSUFFIX/alpha}" ]]; then
- MINalpha="${MINSUFFIX##alpha}"
- elif [[ "$MINSUFFIX" != "${MINSUFFIX/beta}" ]]; then
- MINbeta="${MINSUFFIX##beta}"
- elif [[ "$MINSUFFIX" != "${MINSUFFIX/pre}" ]]; then
- MINpre="${MINSUFFIX##pre}"
- elif [[ "$MINSUFFIX" != "${MINSUFFIX/rc}" ]]; then
- MINrc="${MINSUFFIX##rc}"
- else
- die "deprange(): version suffix $MINSUFFIX (probably _pN) not supported"
- fi
- local MAXalpha MAXbeta MAXpre MAXrc
- if [[ "$MAXSUFFIX" != "${MAXSUFFIX/alpha}" ]]; then
- MAXalpha="${MAXSUFFIX##alpha}"
- elif [[ "$MAXSUFFIX" != "${MAXSUFFIX/beta}" ]]; then
- MAXbeta="${MAXSUFFIX##beta}"
- elif [[ "$MAXSUFFIX" != "${MAXSUFFIX/pre}" ]]; then
- MAXpre="${MAXSUFFIX##pre}"
- elif [[ "$MAXSUFFIX" != "${MAXSUFFIX/rc}" ]]; then
- MAXrc="${MAXSUFFIX##rc}"
- else
- die "deprange(): version suffix $MAXSUFFIX (probably _pN) not supported"
- fi
-
- local started="" NEWDEP="" var
-
- # Loop over version suffixes
- for suffix in rc pre beta alpha; do
- local upper="" lower=""
-
- # If -n $started, we've encountered the upper bound in a previous iteration
- # and so we use the maximum allowed upper bound for this prefix
- if [[ -n "$started" ]]; then
- upper=10
-
- else
-
- # Test for the upper bound in the current iteration
- var=MAX$suffix
- if [[ -n "${!var}" ]]; then
- upper=${!var}
- started=yes
- fi
- fi
-
- # If the upper bound has been found
- if [[ -n "$upper" ]]; then
-
- # Test for the lower bound in the current iteration (of the loop over prefixes)
- var=MIN$suffix
- if [[ -n "${!var}" ]]; then
- lower=${!var}
-
- # If the lower bound has a revision number, don't touch that yet
- if [[ -n "$MINREV" ]]; then
- let lower++
- fi
-
- # If not found, we go down to the minimum allowed for this prefix
- else
- lower=1
- fi
-
- # Add allowed versions with this prefix
- NEWDEP="$NEWDEP
- $(deprange-iterate-numbers ${NAME}_${suffix} $lower $upper)"
-
- # If we've encountered the lower bound on this iteration, don't consider additional prefixes
- if [[ -n "${!var}" ]]; then
- break
- fi
- fi
- done
- echo -n $NEWDEP
-}
-
-# @FUNCTION: deprange-dual
-# @USAGE: < minver > < maxver > < package >
-# @DESCRIPTION:
-# Wrapper around deprange() used for deps between split ebuilds.
-# It adds the parent monolithic ebuild of the dep as an alternative dep.
-# See deprange above for more deatils.
-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 $CATEGORY/$PN)" ]]; 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
# ---------------------------------------------------------------
@@ -640,19 +389,10 @@ need-kde() {
fi
if [[ -n "${KDEBASE}" ]]; then
# If we're a kde-base package, we need at least our own version of kdelibs.
- # Also, split kde-base ebuilds are not updated with every KDE release, and so
- # can require support of different versions of kdelibs.
- # KM_DEPRANGE should contain 2nd and 3rd parameter to deprange:
- # max and min KDE versions. E.g. KM_DEPRANGE="$PV $MAXKDEVER".
# Note: we only set RDEPEND if it is already set, otherwise
# we break packages relying on portage copying RDEPEND from DEPEND.
- if [[ -n "${KM_DEPRANGE}" ]]; then
- DEPEND="${DEPEND} $(deprange ${KM_DEPRANGE} kde-base/kdelibs)"
- RDEPEND="${x_DEPEND} $(deprange ${KM_DEPRANGE} kde-base/kdelibs)"
- else
- DEPEND="${DEPEND} ~kde-base/kdelibs-$PV"
- RDEPEND="${x_DEPEND} ~kde-base/kdelibs-${PV}"
- fi
+ DEPEND="${DEPEND} ~kde-base/kdelibs-$PV"
+ RDEPEND="${x_DEPEND} ~kde-base/kdelibs-${PV}"
else
# Things outside kde-base need a minimum version,
# but kde-base/kdelibs:kde-4 mustn't satisfy it.