Gentoo Archives: gentoo-commits

From: "Jonathan Callen (abcd)" <abcd@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in eclass: kde-functions.eclass
Date: Sun, 01 Nov 2009 09:45:11
Message-Id: E1N4WyG-0003Pc-1T@stork.gentoo.org
1 abcd 09/11/01 09:43:36
2
3 Modified: kde-functions.eclass
4 Log:
5 Drop the old deprange code, no longer used (if needed, use EAPI-1 SLOT deps)
6
7 Revision Changes Path
8 1.174 eclass/kde-functions.eclass
9
10 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/kde-functions.eclass?rev=1.174&view=markup
11 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/kde-functions.eclass?rev=1.174&content-type=text/plain
12 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/kde-functions.eclass?r1=1.173&r2=1.174
13
14 Index: kde-functions.eclass
15 ===================================================================
16 RCS file: /var/cvsroot/gentoo-x86/eclass/kde-functions.eclass,v
17 retrieving revision 1.173
18 retrieving revision 1.174
19 diff -u -r1.173 -r1.174
20 --- kde-functions.eclass 13 May 2009 21:00:42 -0000 1.173
21 +++ kde-functions.eclass 1 Nov 2009 09:43:35 -0000 1.174
22 @@ -1,6 +1,6 @@
23 # Copyright 1999-2008 Gentoo Foundation
24 # Distributed under the terms of the GNU General Public License v2
25 -# $Header: /var/cvsroot/gentoo-x86/eclass/kde-functions.eclass,v 1.173 2009/05/13 21:00:42 scarabeus Exp $
26 +# $Header: /var/cvsroot/gentoo-x86/eclass/kde-functions.eclass,v 1.174 2009/11/01 09:43:35 abcd Exp $
27
28 # @ECLASS: kde-functions.eclass
29 # @MAINTAINER:
30 @@ -365,257 +365,6 @@
31 return 1
32 }
33
34 -# @FUNCTION: deprange
35 -# @USAGE: < minver > < maxver > < package > [...]
36 -# @DESCRIPTION:
37 -# For minver, a -rN part is supported. For both minver and maxver, _alpha/beta/pre/rc suffixes
38 -# are supported, but not _p suffixes or teminating letters (eg 3.3.1a).
39 -#
40 -# This function echoes a string of the form (for package="kde-base/kdelibs")
41 -# || ( =kde-base/kdelibs-3.3.1-r1 ~kde-base/kdelibs-3.3.2 ~kde-base/kdelibs-3.3.3 )
42 -# This dep means versions of package from maxver through minver will be acceptable.
43 -# Note that only the kde versioning scheme is supported - ie x.y, and we only iterate through y
44 -# (i.e. x can contain more . separators).
45 -deprange() {
46 - local list="$(deprange-list $@)"
47 - if [[ ${list%% *} == "${list}" ]]; then
48 - echo "${list}"
49 - else
50 - echo "|| ( ${list} )"
51 - fi
52 -}
53 -
54 -deprange-list() {
55 - # Assign, parse params
56 - local MINVER=$1; shift
57 - local MAXVER=$1; shift
58 -
59 - # Workaround for 3.5.0_beta1 ebuilds being mistakenly versioned as 3.5_beta1
60 - # Ugly kludge, but will disappear once 3.5 prerelease ebuilds are removed from portage
61 - if [[ "$MINVER" == "3.5_beta1" ]]; then
62 -
63 - MINVER="3.5.0_beta1"
64 - FINALOPTIONVER="3.5_beta1"
65 - fi
66 - if [[ "$MAXVER" == "3.5_beta1" ]]; then
67 - MAXVER="3.5.0_beta1"
68 - fi
69 -
70 - # Get base version - the major X.Y components
71 - local BASEVER=${MINVER%.*}
72 - if [[ "${MAXVER%.*}" != "$BASEVER" ]]; then
73 - die "deprange(): unsupported parameters $MINVER $MAXVER - BASEVER must be identical"
74 - fi
75 -
76 - # Get version suffixes
77 - local MINSUFFIX MAXSUFFIX
78 - if [[ "$MINVER" != "${MINVER/_}" ]]; then
79 - MINSUFFIX=${MINVER##*_}
80 - SUFFIXLESSMINVER=${MINVER%_*}
81 - else
82 - SUFFIXLESSMINVER=$MINVER
83 - fi
84 - if [[ "$MAXVER" != "${MAXVER/_}" ]]; then
85 - MAXSUFFIX=${MAXVER##*_}
86 - SUFFIXLESSMAXVER=${MAXVER%_*}
87 - else
88 - SUFFIXLESSMAXVER=$MAXVER
89 - fi
90 -
91 - # Separate out the optional lower bound revision number
92 - if [[ "$MINVER" != "${MINVER/-}" ]]; then
93 - local MINREV=${MINVER##*-}
94 - fi
95 -
96 - # Get minor version components (the 1 in 3.3.1)
97 - local MINMINOR=${SUFFIXLESSMINVER##*.}
98 - local MAXMINOR=${SUFFIXLESSMAXVER##*.}
99 -
100 - # Iterate over packages
101 - while [[ -n "$1" ]]; do
102 - local PACKAGE=$1
103 - shift
104 -
105 - local NEWDEP=""
106 -
107 - # If the two versions are identical, our job is simple
108 - if [[ "$MINVER" == "$MAXVER" ]]; then
109 - NEWDEP="~$PACKAGE-$MINVER"
110 -
111 - # If the range bounds differ only by their suffixes
112 - elif [[ "$MINMINOR" == "$MAXMINOR" ]]; then
113 - NEWDEP="$(deprange-iterate-suffixes "~$PACKAGE-$BASEVER.$MINMINOR" $MINSUFFIX $MAXSUFFIX)"
114 -
115 - # Revision constraint on lower bound
116 - if [[ -n "$MINREV" ]]; then
117 - NEWDEP="$NEWDEP
118 - $(deprange-iterate-numbers "=$PACKAGE-$BASEVER.${MINMINOR}_$MINSUFFIX-r" $MINREV 50)"
119 - fi
120 -
121 - # If the minor version numbers are different too
122 - else
123 - # Max version's allowed suffixes
124 - if [[ -n "$MAXSUFFIX" ]]; then
125 - NEWDEP="$(deprange-iterate-suffixes "~$PACKAGE-$BASEVER.$MAXMINOR" alpha1 $MAXSUFFIX)"
126 - fi
127 -
128 - STARTMINOR="${MINMINOR}"
129 -
130 - # regular versions in between
131 - if [[ -n "$MINREV" ]] && [[ -z "$MINSUFFIX" ]]; then
132 - let STARTMINOR++
133 - fi
134 - NEWDEP="$NEWDEP
135 - $(deprange-iterate-numbers "~${PACKAGE}-${BASEVER}." $STARTMINOR $MAXMINOR)"
136 -
137 - # Min version's allowed suffixes
138 - if [[ -n "$MINSUFFIX" ]]; then
139 - NEWDEP="$NEWDEP
140 - $(deprange-iterate-suffixes "~$PACKAGE-$BASEVER.$MINMINOR" $MINSUFFIX rc10)"
141 - fi
142 - if [[ -n "$MINREV" ]]; then
143 - local BASE
144 - if [[ -n "$MINSUFFIX" ]]; then
145 - BASE="=$PACKAGE-$BASEVER.${MINMINOR}_${MINSUFFIX%-r*}-r"
146 - else
147 - BASE="=$PACKAGE-$BASEVER.${MINMINOR%-r*}-r"
148 - fi
149 - NEWDEP="$NEWDEP
150 - $(deprange-iterate-numbers $BASE ${MINREV#r} 50)"
151 - fi
152 - fi
153 -
154 - # second part of kludge
155 - if [[ -n "$FINALOPTIONVER" ]]; then
156 - NEWDEP="$NEWDEP ~$PACKAGE-$FINALOPTIONVER"
157 - fi
158 -
159 - # Output
160 - echo -n $NEWDEP
161 - done
162 -}
163 -
164 -# This internal function iterates over simple ranges where only a numerical suffix changes
165 -# Parameters: base name, lower bound, upper bound
166 -deprange-iterate-numbers() {
167 - local package=$1 lower=$2 upper=$3 i newdep=""
168 - for (( i=$upper ; $i >= $lower ; i-- )) ; do
169 - newdep="$newdep ${package}${i}"
170 - done
171 - echo -n $newdep
172 -}
173 -
174 -# This internal function iterates over ranges with the same base version and different suffixes.
175 -# If the lower bound has a revision number, this function won't mention the lower bound in its output.
176 -# Parameters: base name, lower version suffix, upper version suffix
177 -# eg: deprange-iterate-suffixes ~kde-base/libkonq-3.4.0 alpha8 beta2
178 -deprange-iterate-suffixes() {
179 - local NAME=$1 MINSUFFIX=$2 MAXSUFFIX=$3
180 -
181 - # Separate out the optional lower bound revision number
182 - if [[ "$MINSUFFIX" != "${MINSUFFIX/-}" ]]; then
183 - local MINREV=${MINSUFFIX##*-}
184 - fi
185 - MINSUFFIX=${MINSUFFIX%-*}
186 -
187 - # Separate out the version suffixes
188 - local MINalpha MINbeta MINpre MINrc
189 - if [[ "$MINSUFFIX" != "${MINSUFFIX/alpha}" ]]; then
190 - MINalpha="${MINSUFFIX##alpha}"
191 - elif [[ "$MINSUFFIX" != "${MINSUFFIX/beta}" ]]; then
192 - MINbeta="${MINSUFFIX##beta}"
193 - elif [[ "$MINSUFFIX" != "${MINSUFFIX/pre}" ]]; then
194 - MINpre="${MINSUFFIX##pre}"
195 - elif [[ "$MINSUFFIX" != "${MINSUFFIX/rc}" ]]; then
196 - MINrc="${MINSUFFIX##rc}"
197 - else
198 - die "deprange(): version suffix $MINSUFFIX (probably _pN) not supported"
199 - fi
200 - local MAXalpha MAXbeta MAXpre MAXrc
201 - if [[ "$MAXSUFFIX" != "${MAXSUFFIX/alpha}" ]]; then
202 - MAXalpha="${MAXSUFFIX##alpha}"
203 - elif [[ "$MAXSUFFIX" != "${MAXSUFFIX/beta}" ]]; then
204 - MAXbeta="${MAXSUFFIX##beta}"
205 - elif [[ "$MAXSUFFIX" != "${MAXSUFFIX/pre}" ]]; then
206 - MAXpre="${MAXSUFFIX##pre}"
207 - elif [[ "$MAXSUFFIX" != "${MAXSUFFIX/rc}" ]]; then
208 - MAXrc="${MAXSUFFIX##rc}"
209 - else
210 - die "deprange(): version suffix $MAXSUFFIX (probably _pN) not supported"
211 - fi
212 -
213 - local started="" NEWDEP="" var
214 -
215 - # Loop over version suffixes
216 - for suffix in rc pre beta alpha; do
217 - local upper="" lower=""
218 -
219 - # If -n $started, we've encountered the upper bound in a previous iteration
220 - # and so we use the maximum allowed upper bound for this prefix
221 - if [[ -n "$started" ]]; then
222 - upper=10
223 -
224 - else
225 -
226 - # Test for the upper bound in the current iteration
227 - var=MAX$suffix
228 - if [[ -n "${!var}" ]]; then
229 - upper=${!var}
230 - started=yes
231 - fi
232 - fi
233 -
234 - # If the upper bound has been found
235 - if [[ -n "$upper" ]]; then
236 -
237 - # Test for the lower bound in the current iteration (of the loop over prefixes)
238 - var=MIN$suffix
239 - if [[ -n "${!var}" ]]; then
240 - lower=${!var}
241 -
242 - # If the lower bound has a revision number, don't touch that yet
243 - if [[ -n "$MINREV" ]]; then
244 - let lower++
245 - fi
246 -
247 - # If not found, we go down to the minimum allowed for this prefix
248 - else
249 - lower=1
250 - fi
251 -
252 - # Add allowed versions with this prefix
253 - NEWDEP="$NEWDEP
254 - $(deprange-iterate-numbers ${NAME}_${suffix} $lower $upper)"
255 -
256 - # If we've encountered the lower bound on this iteration, don't consider additional prefixes
257 - if [[ -n "${!var}" ]]; then
258 - break
259 - fi
260 - fi
261 - done
262 - echo -n $NEWDEP
263 -}
264 -
265 -# @FUNCTION: deprange-dual
266 -# @USAGE: < minver > < maxver > < package >
267 -# @DESCRIPTION:
268 -# Wrapper around deprange() used for deps between split ebuilds.
269 -# It adds the parent monolithic ebuild of the dep as an alternative dep.
270 -# See deprange above for more deatils.
271 -deprange-dual() {
272 - local MIN=$1 MAX=$2 NEWDEP=""
273 - shift; shift
274 - for PACKAGE in $@; do
275 - PARENT=$(get-parent-package $PACKAGE)
276 - NEWDEP="$NEWDEP || ( $(deprange-list $MIN $MAX $PACKAGE)"
277 - if [[ "$PARENT" != "$(get-parent-package $CATEGORY/$PN)" ]]; then
278 - NEWDEP="$NEWDEP $(deprange-list $MIN $MAX $PARENT)"
279 - fi
280 - NEWDEP="$NEWDEP )"
281 - done
282 - echo -n $NEWDEP
283 -}
284 -
285 # ---------------------------------------------------------------
286 # kde/qt directory management etc. functions, was kde-dirs.ebuild
287 # ---------------------------------------------------------------