* [gentoo-commits] gentoo-x86 commit in eclass: alternatives.eclass
@ 2008-09-10 8:10 Peter Volkov (pva)
0 siblings, 0 replies; 2+ messages in thread
From: Peter Volkov (pva) @ 2008-09-10 8:10 UTC (permalink / raw
To: gentoo-commits
pva 08/09/10 08:10:32
Modified: alternatives.eclass
Log:
Make eclass-manpages ready, bug #210058, thank mren for report.
Revision Changes Path
1.15 eclass/alternatives.eclass
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/alternatives.eclass?rev=1.15&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/alternatives.eclass?rev=1.15&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/alternatives.eclass?r1=1.14&r2=1.15
Index: alternatives.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/alternatives.eclass,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- alternatives.eclass 15 May 2007 15:20:59 -0000 1.14
+++ alternatives.eclass 10 Sep 2008 08:10:31 -0000 1.15
@@ -1,48 +1,55 @@
-# Copyright 1999-2004 Gentoo Foundation
+# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/alternatives.eclass,v 1.14 2007/05/15 15:20:59 ulm Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/alternatives.eclass,v 1.15 2008/09/10 08:10:31 pva Exp $
-# Author : Alastair Tse <liquidx@gentoo.org> (03 Oct 2003)
-# Short Desc: Creates symlink to the latest version of multiple slotted
-# packages.
-#
-# Long Desc:
-#
-# When a package is SLOT'ed, very often we need to have a symlink to the
-# 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
-# list of alternatives (descending order of recent-ness) and the symlink.
-# It will choose the latest version it can find installed and create
-# 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
-# $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"
-# }
-#
-# The above example will create a symlink at /usr/bin/python to either
-# /usr/bin/python2.3 or /usr/bin/python2.2. It will choose python2.3 over
-# python2.2 if both exist.
-#
-# Alternatively, you can use this function:
-#
-# 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.
+# @ECLASS: alternatives.eclass
+# @MAINTAINER:
#
+# Original author : Alastair Tse <liquidx@gentoo.org> (03 Oct 2003)
+# @BLURB: Creates symlink to the latest version of multiple slotted packages.
+# @DESCRIPTION:
+# When a package is SLOT'ed, very often we need to have a symlink to the
+# 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
+# list of alternatives (descending order of recent-ness) and the symlink.
+# It will choose the latest version it can find installed and create
+# 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
+# $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"
+# }
+#
+# The above example will create a symlink at /usr/bin/python to either
+# /usr/bin/python2.3 or /usr/bin/python2.2. It will choose python2.3 over
+# python2.2 if both exist.
+#
+# Alternatively, you can use this function:
+#
+# 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.
+
+# @ECLASS-VARIABLE: SOURCE
+# @DESCRIPTION:
+# The symlink to be created
+
+# @ECLASS-VARIABLE: ALTERNATIVES
+# @DESCRIPTION:
+# The list of alternatives
+# @FUNCTION: alternatives_auto_makesym
+# @DESCRIPTION:
# automatic deduction based on a symlink and a regex mask
alternatives_auto_makesym() {
local SYMLINK REGEX ALT myregex
@@ -110,12 +117,18 @@
fi
}
+# @FUNCTION: alernatives-pkg_postinst
+# @DESCRIPTION:
+# The alternatives pkg_postinst, this function will be exported
alternatives_pkg_postinst() {
if [ -n "${ALTERNATIVES}" -a -n "${SOURCE}" ]; then
alternatives_makesym ${SOURCE} ${ALTERNATIVES}
fi
}
+# @FUNCTION: alternatives_pkg_postrm
+# @DESCRIPTION:
+# The alternatives pkg_postrm, this function will be exported
alternatives_pkg_postrm() {
if [ -n "${ALTERNATIVES}" -a -n "${SOURCE}" ]; then
alternatives_makesym ${SOURCE} ${ALTERNATIVES}
^ permalink raw reply [flat|nested] 2+ messages in thread
* [gentoo-commits] gentoo-x86 commit in eclass: alternatives.eclass
@ 2010-11-24 6:49 Ulrich Mueller (ulm)
0 siblings, 0 replies; 2+ messages in thread
From: Ulrich Mueller (ulm) @ 2010-11-24 6:49 UTC (permalink / raw
To: gentoo-commits
ulm 10/11/24 06:49:41
Modified: alternatives.eclass
Log:
Add @DEFAULT_UNSET tags to variables to suppress warnings in eclass-manpages.
Revision Changes Path
1.16 eclass/alternatives.eclass
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/alternatives.eclass?rev=1.16&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/alternatives.eclass?rev=1.16&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/alternatives.eclass?r1=1.15&r2=1.16
Index: alternatives.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/alternatives.eclass,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- alternatives.eclass 10 Sep 2008 08:10:31 -0000 1.15
+++ alternatives.eclass 24 Nov 2010 06:49:41 -0000 1.16
@@ -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/alternatives.eclass,v 1.15 2008/09/10 08:10:31 pva Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/alternatives.eclass,v 1.16 2010/11/24 06:49:41 ulm Exp $
# @ECLASS: alternatives.eclass
# @MAINTAINER:
@@ -41,10 +41,12 @@
# consider using this unless you are want to do something special.
# @ECLASS-VARIABLE: SOURCE
+# @DEFAULT_UNSET
# @DESCRIPTION:
# The symlink to be created
# @ECLASS-VARIABLE: ALTERNATIVES
+# @DEFAULT_UNSET
# @DESCRIPTION:
# The list of alternatives
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-11-24 6:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-24 6:49 [gentoo-commits] gentoo-x86 commit in eclass: alternatives.eclass Ulrich Mueller (ulm)
-- strict thread matches above, loose matches on Subject: below --
2008-09-10 8:10 Peter Volkov (pva)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox