diff options
author | Sven Wegener <swegener@gentoo.org> | 2005-07-11 15:08:07 +0000 |
---|---|---|
committer | Sven Wegener <swegener@gentoo.org> | 2005-07-11 15:08:07 +0000 |
commit | a18b8c502d697dde5b46e9fa54867d99d8528c63 (patch) | |
tree | 5e3d3675e2764dc2b1589043df9a5864c250ca17 /eclass/alternatives.eclass | |
parent | Update to support selinux USE flag (blame spb). (diff) | |
download | historical-a18b8c502d697dde5b46e9fa54867d99d8528c63.tar.gz historical-a18b8c502d697dde5b46e9fa54867d99d8528c63.tar.bz2 historical-a18b8c502d697dde5b46e9fa54867d99d8528c63.zip |
QA: Apply whitespace checks from repoman to eclasses.
Diffstat (limited to 'eclass/alternatives.eclass')
-rw-r--r-- | eclass/alternatives.eclass | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/eclass/alternatives.eclass b/eclass/alternatives.eclass index e25f7d769c2a..e5cbcffa2dfd 100644 --- a/eclass/alternatives.eclass +++ b/eclass/alternatives.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/alternatives.eclass,v 1.11 2005/07/06 20:23:20 agriffis Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/alternatives.eclass,v 1.12 2005/07/11 15:08:06 swegener Exp $ # Author : Alastair Tse <liquidx@gentoo.org> (03 Oct 2003) # Short Desc: Creates symlink to the latest version of multiple slotted @@ -12,18 +12,18 @@ # latest version. However, depending on the order the user has merged them, # more often than not, the symlink maybe clobbered by the older versions. # -# This eclass provides a convenience function that needs to be given a +# This eclass provides a convenience function that needs to be given a # list of alternatives (descending order of recent-ness) and the symlink. # It will choose the latest version if can find installed and create -# the desired symlink. +# the desired symlink. # -# There are two ways to use this eclass. First is by declaring two variables -# $SOURCE and $ALTERNATIVES where $SOURCE is the symlink to be created and +# There are two ways to use this eclass. First is by declaring two variables +# $SOURCE and $ALTERNATIVES where $SOURCE is the symlink to be created and # $ALTERNATIVES is a list of alternatives. Second way is the use the function # alternatives_makesym() like the example below. # # Example: -# +# # pkg_postinst() { # alternatives_makesym "/usr/bin/python" "/usr/bin/python2.3" "/usr/bin/python2.2" # } @@ -37,18 +37,18 @@ # pkg_postinst() { # alternatives_auto_makesym "/usr/bin/python" "/usr/bin/python[0-9].[0-9]" # } -# +# # This will use bash pathname expansion to fill a list of alternatives it can # link to. It is probably more robust against version upgrades. You should # consider using this unless you are want to do something special. -# +# # automatic deduction based on a symlink and a regex mask alternatives_auto_makesym() { local SYMLINK REGEX ALT myregex SYMLINK=$1 REGEX=$2 - if [ "${REGEX:0:1}" != "/" ] + if [ "${REGEX:0:1}" != "/" ] then #not an absolute path: #inherit the root directory of our main link path for our regex search @@ -68,7 +68,7 @@ alternatives_makesym() { local ALTERNATIVES="" local SYMLINK="" local alt pref - + # usage: alternatives_makesym <resulting symlink> [alternative targets..] SYMLINK=$1 # this trick removes the trailing / from ${ROOT} @@ -78,7 +78,7 @@ alternatives_makesym() { # step through given alternatives from first to last # and if one exists, link it and finish. - + for alt in ${ALTERNATIVES}; do if [ -f "${pref}${alt}" ]; then #are files in same directory? @@ -95,7 +95,7 @@ alternatives_makesym() { break fi done - + # report any errors if [ ! -L ${pref}${SYMLINK} ]; then ewarn "Unable to establish ${pref}${SYMLINK} symlink" @@ -106,13 +106,13 @@ alternatives_makesym() { ! -f "`readlink ${pref}${SYMLINK}`" ]; then ewarn "${pref}${SYMLINK} is a dead symlink." fi - fi -} + fi +} alternatives_pkg_postinst() { if [ -n "${ALTERNATIVES}" -a -n "${SOURCE}" ]; then alternatives_makesym ${SOURCE} ${ALTERNATIVES} - fi + fi } alternatives_pkg_postrm() { @@ -122,4 +122,3 @@ alternatives_pkg_postrm() { } EXPORT_FUNCTIONS pkg_postinst pkg_postrm - |