/[gentoo-x86]/eclass/kde4-functions.eclass
Gentoo

Diff of /eclass/kde4-functions.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.26 Revision 1.27
1# Copyright 1999-2009 Gentoo Foundation 1# Copyright 1999-2009 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-functions.eclass,v 1.26 2009/10/27 14:16:49 scarabeus Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-functions.eclass,v 1.27 2009/12/01 10:56:17 scarabeus Exp $
4 4
5inherit versionator 5inherit versionator
6 6
7# @ECLASS: kde4-functions.eclass 7# @ECLASS: kde4-functions.eclass
8# @MAINTAINER: 8# @MAINTAINER:
376# As an example, if SLOT=live, then 376# As an example, if SLOT=live, then
377# add_blocker kdelibs 0 :4.3 '<4.3.96:4.4' 9999:live 377# add_blocker kdelibs 0 :4.3 '<4.3.96:4.4' 9999:live
378# will add the following to RDEPEND: 378# will add the following to RDEPEND:
379# !kdeprefix? ( !kde-base/kdelibs:4.3[-kdeprefix] ) 379# !kdeprefix? ( !kde-base/kdelibs:4.3[-kdeprefix] )
380# !kdeprefix? ( !<kde-base/kdelibs-4.3.96:4.4[-kdeprefix] ) 380# !kdeprefix? ( !<kde-base/kdelibs-4.3.96:4.4[-kdeprefix] )
381# !kdeprefix? ( !<=kde-base/kdelibs-9999:live[-kdeprefix] ) 381# !<=kde-base/kdelibs-9999:live
382# kdeprefix? ( !<=kde-base/kdelibs-9999:live[kdeprefix] )
383add_blocker() { 382add_blocker() {
384 debug-print-function ${FUNCNAME} "$@" 383 debug-print-function ${FUNCNAME} "$@"
385 384
386 RDEPEND+=" $(_do_blocker "$@")" 385 RDEPEND+=" $(_do_blocker "$@")"
387} 386}
397 [[ $slot == live ]] && return 1 396 [[ $slot == live ]] && return 1
398 # Otherwise, for slot X.Y, test against X.Y.50 397 # Otherwise, for slot X.Y, test against X.Y.50
399 local test=${slot}.50 398 local test=${slot}.50
400 version_compare $1 ${test} 399 version_compare $1 ${test}
401 # 1 = '<', 2 = '=', 3 = '>' 400 # 1 = '<', 2 = '=', 3 = '>'
402 [[ $? -ne 1 ]] 401 (( $? != 1 ))
403} 402}
404 403
405# _less_min_in_slot ver slot 404# _less_min_in_slot ver slot
406# slot must be 4.x or live 405# slot must be 4.x or live
407# returns true if ver is <= the minimum possibile version in slot 406# returns true if ver is <= the minimum possibile version in slot
409 local ver=$1 408 local ver=$1
410 local slot=$2 409 local slot=$2
411 # If slot == live, then test with "9999_pre", so that 9999 tests false 410 # If slot == live, then test with "9999_pre", so that 9999 tests false
412 local test=9999_pre 411 local test=9999_pre
413 # If slot == X.Y, then test with X.(Y-1).50 412 # If slot == X.Y, then test with X.(Y-1).50
414 [[ $slot == live ]] || test=${slot%.*}.$((${slot#*.} - 1)).50 413 [[ $slot != live ]] && test=${slot%.*}.$((${slot#*.} - 1)).50
415 version_compare $1 ${test} 414 version_compare $1 ${test}
416 # 1 = '<', 2 = '=', 3 = '>' 415 # 1 = '<', 2 = '=', 3 = '>'
417 [[ $? -ne 3 ]] 416 (( $? != 3 ))
418} 417}
419 418
420# Internal function used for add_blocker and block_other_slots 419# Internal function used for add_blocker and block_other_slots
421# This takes the same parameters as add_blocker, but echos to 420# This takes the same parameters as add_blocker, but echos to
422# stdout instead of updating a variable. 421# stdout instead of updating a variable.
472 # this also removes the first character of the version, which is a "<" 471 # this also removes the first character of the version, which is a "<"
473 atom="<${pkg}-${!var:1}" 472 atom="<${pkg}-${!var:1}"
474 else 473 else
475 atom="<=${pkg}-${!var}" 474 atom="<=${pkg}-${!var}"
476 fi 475 fi
477 # on -kdeprefix we block every slot 476 # we always block our own slot, ignoring kdeprefix
478 echo " !kdeprefix? ( !${atom}:${slot}[-kdeprefix] )"
479 # on kdeprefix we block only our slot
480 if [[ ${SLOT} == ${slot} ]]; then 477 if [[ ${SLOT} == ${slot} ]]; then
478 echo " !${atom}:${slot}"
479 else
480 # we only block other slots on -kdeprefix
481 echo " kdeprefix? ( !${atom}:${SLOT}[kdeprefix] )" 481 echo " !kdeprefix? ( !${atom}:${slot}[-kdeprefix] )"
482 fi 482 fi
483 done 483 done
484 484
485 # This is a special case block for :3.5; it does not use the 485 # This is a special case block for :3.5; it does not use the
486 # default version passed, and no blocker is output *unless* a version 486 # default version passed, and no blocker is output *unless* a version
512 512
513 [[ -z ${1} ]] && die "Missing parameter" 513 [[ -z ${1} ]] && die "Missing parameter"
514 514
515 local use=${2:+,${2}} 515 local use=${2:+,${2}}
516 516
517 echo "!kdeprefix? ( >=kde-base/${1}-${PV}[-kdeprefix${use}] )" 517 echo " !kdeprefix? ( >=kde-base/${1}-${PV}[-kdeprefix${use}] )"
518 echo "kdeprefix? ( >=kde-base/${1}-${PV}:${SLOT}[kdeprefix${use}] )" 518 echo " kdeprefix? ( >=kde-base/${1}-${PV}:${SLOT}[kdeprefix${use}] )"
519} 519}

Legend:
Removed from v.1.26  
changed lines
  Added in v.1.27

  ViewVC Help
Powered by ViewVC 1.1.20