/[gentoo-x86]/eclass/versionator.eclass
Gentoo

Diff of /eclass/versionator.eclass

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

Revision 1.12 Revision 1.13
1# Copyright 1999-2004 Gentoo Foundation 1# Copyright 1999-2004 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/versionator.eclass,v 1.12 2007/01/10 05:49:10 antarus Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/versionator.eclass,v 1.13 2007/04/23 19:35:05 swegener Exp $
4# 4#
5# Original Author: Ciaran McCreesh <ciaranm@gentoo.org> 5# Original Author: Ciaran McCreesh <ciaranm@gentoo.org>
6# 6#
7# This eclass provides functions which simplify manipulating $PV and similar 7# This eclass provides functions which simplify manipulating $PV and similar
8# variables. Most functions default to working with $PV, although other 8# variables. Most functions default to working with $PV, although other
150# version parameter is supplied, defaults to $PV. 150# version parameter is supplied, defaults to $PV.
151# 1 1.2.3 -> 1 151# 1 1.2.3 -> 1
152# 1-2 1.2.3 -> 1.2 152# 1-2 1.2.3 -> 1.2
153# 2- 1.2.3 -> 2.3 153# 2- 1.2.3 -> 2.3
154get_version_component_range() { 154get_version_component_range() {
155 __versionator_shopt_toggle on 155 __versionator_shopt_toggle on
156 local c v="${2:-${PV}}" range="${1}" range_start range_end i=-1 j=0 156 local c v="${2:-${PV}}" range="${1}" range_start range_end i=-1 j=0
157 c=( $(get_all_version_components ${v} ) ) 157 c=( $(get_all_version_components ${v} ) )
158 range_start="${range%-*}" ; range_start="${range_start:-1}" 158 range_start="${range%-*}" ; range_start="${range_start:-1}"
159 range_end="${range#*-}" ; range_end="${range_end:-${#c[@]}}" 159 range_end="${range#*-}" ; range_end="${range_end:-${#c[@]}}"
160 160

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.13

  ViewVC Help
Powered by ViewVC 1.1.20