diff options
author | George Shapovalov <george@gentoo.org> | 2008-02-07 18:03:40 +0000 |
---|---|---|
committer | George Shapovalov <george@gentoo.org> | 2008-02-07 18:03:40 +0000 |
commit | e55a97aaf981675cadbb6ccc167444dcc0076b6b (patch) | |
tree | dc4ba6a5e21f2c66fea687ef106e0889e2513963 /app-admin/eselect-gnat | |
parent | adjusted comments to reflect present standing on #192505 (diff) | |
download | historical-e55a97aaf981675cadbb6ccc167444dcc0076b6b.tar.gz historical-e55a97aaf981675cadbb6ccc167444dcc0076b6b.tar.bz2 historical-e55a97aaf981675cadbb6ccc167444dcc0076b6b.zip |
pulled obsolete versions
Package-Manager: portage-2.1.4.1
Diffstat (limited to 'app-admin/eselect-gnat')
-rw-r--r-- | app-admin/eselect-gnat/ChangeLog | 12 | ||||
-rw-r--r-- | app-admin/eselect-gnat/Manifest | 15 | ||||
-rw-r--r-- | app-admin/eselect-gnat/eselect-gnat-0.9.ebuild | 25 | ||||
-rw-r--r-- | app-admin/eselect-gnat/eselect-gnat-1.0-r1.ebuild | 24 | ||||
-rw-r--r-- | app-admin/eselect-gnat/eselect-gnat-1.0.ebuild | 25 | ||||
-rw-r--r-- | app-admin/eselect-gnat/eselect-gnat-1.1-r1.ebuild | 32 | ||||
-rw-r--r-- | app-admin/eselect-gnat/eselect-gnat-1.1.ebuild | 32 | ||||
-rw-r--r-- | app-admin/eselect-gnat/eselect-gnat-1.3.ebuild | 32 | ||||
-rw-r--r-- | app-admin/eselect-gnat/files/gnat-common-1.3.bash | 218 | ||||
-rw-r--r-- | app-admin/eselect-gnat/files/gnat-common.bash | 187 | ||||
-rw-r--r-- | app-admin/eselect-gnat/files/gnat.eselect-0.9 | 300 | ||||
-rw-r--r-- | app-admin/eselect-gnat/files/gnat.eselect-1.0 | 306 | ||||
-rw-r--r-- | app-admin/eselect-gnat/files/gnat.eselect-1.0-r1 | 308 | ||||
-rw-r--r-- | app-admin/eselect-gnat/files/gnat.eselect-1.1 | 207 | ||||
-rw-r--r-- | app-admin/eselect-gnat/files/gnat.eselect-1.1-r1 | 207 |
15 files changed, 12 insertions, 1918 deletions
diff --git a/app-admin/eselect-gnat/ChangeLog b/app-admin/eselect-gnat/ChangeLog index 032f4b5450b5..a201b7588302 100644 --- a/app-admin/eselect-gnat/ChangeLog +++ b/app-admin/eselect-gnat/ChangeLog @@ -1,6 +1,16 @@ # ChangeLog for app-admin/eselect-gnat # Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-admin/eselect-gnat/ChangeLog,v 1.21 2008/02/05 18:30:52 opfer Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-admin/eselect-gnat/ChangeLog,v 1.22 2008/02/07 18:03:39 george Exp $ + + 07 Feb 2008; George Shapovalov <george@gentoo.org> + -files/gnat.eselect-0.9, -files/gnat.eselect-1.0, + -files/gnat.eselect-1.0-r1, -files/gnat.eselect-1.1, + -files/gnat.eselect-1.1-r1, -files/gnat-common-1.3.bash, + -files/gnat-common.bash, -eselect-gnat-0.9.ebuild, + -eselect-gnat-1.0.ebuild, -eselect-gnat-1.0-r1.ebuild, + -eselect-gnat-1.1.ebuild, -eselect-gnat-1.1-r1.ebuild, + -eselect-gnat-1.3.ebuild: + pulled obsolete versions 05 Feb 2008; Christian Faulhammer <opfer@gentoo.org> eselect-gnat-1.3-r1.ebuild: diff --git a/app-admin/eselect-gnat/Manifest b/app-admin/eselect-gnat/Manifest index 11513b3daeda..fcd4a63c4239 100644 --- a/app-admin/eselect-gnat/Manifest +++ b/app-admin/eselect-gnat/Manifest @@ -1,21 +1,8 @@ AUX gnat-common-1.2.bash 7020 RMD160 b97f0b72dd97ea8a9a811115d5a21ec106fe2032 SHA1 521ccf56eba14ab35046a4d31f3440aabaf54a3e SHA256 26adff0b6bc5cfdaa968204e546e4cafe9630edcf27e63bbf7831299e0b75b36 AUX gnat-common-1.3-r1.bash 6852 RMD160 e4dfca2ec70c724ff5b762408926c6c404c379c8 SHA1 494746b084e60e43e951fc8457310b0088b9f5a9 SHA256 4454521fc50121ab749daa442674e4240d2f0c25e00e40eca3bf947765afa9c8 -AUX gnat-common-1.3.bash 6638 RMD160 7edcdc54f7279bbe1d518818d79716eaa5e31837 SHA1 532227fdd69a4c7368d2902bcba96e261ff24289 SHA256 01cf7b740921569d2149e8b95e7602a718524e8e38dcd866de42e15ef691ec0b -AUX gnat-common.bash 5393 RMD160 00586b919b0cded2c67f1b605fe08590ef4dd9be SHA1 38ae31a106ca695e5678b6d7189219ec574ac12c SHA256 70f0e90d0798e38900f4ac9da02b4d399a7dab3bf470abab45e332c37c63fe40 -AUX gnat.eselect-0.9 8352 RMD160 c477ea4b9f74a80291d10997ca4b0238d8c9cd09 SHA1 f66537194fd5e3c8ffaee2b1d575b9a2def6fa97 SHA256 1db76f3e94f7f89bc2ebf431c956f9153761d746233a391ee7d86bf37edd0dab -AUX gnat.eselect-1.0 8534 RMD160 fbcc1db63fef7126e6571ca2887823c135f28faa SHA1 4fe5d6f1632f5d573656b220588ea08325d796f1 SHA256 777f8e0000dcadc2d66acd4630f65d87f5603b0df34c26df345a84a79560f285 -AUX gnat.eselect-1.0-r1 8543 RMD160 6a9cfa0b08fee4ea7448756ab103ff036e4406b6 SHA1 f457245d4351610d964fddff28ec15e48a1e3d66 SHA256 f284b06d1feae9cf55aded9edbbea5a25a2e199bd530bd181cc940bf04e16fc3 -AUX gnat.eselect-1.1 5272 RMD160 d3e9005aae997c5ed2ce9538aca158632d25a322 SHA1 328ef6622bedf0b65f21fe759dcda9b6adeb4b10 SHA256 6e40204edece64752ced89e52a3341d54dadc5c3d75626add7162d8ebe9a449f -AUX gnat.eselect-1.1-r1 5295 RMD160 5742c00425baabdcede82242ea9abf15265934b9 SHA1 6805972f9b01be482289a2ab3bee937f105135e3 SHA256 50ef90ac7e613ee5646d573b1f25f94b6cc2aab9ae96468d774c626910246b50 AUX gnat.eselect-1.2 5295 RMD160 ffe82cc91a960c747ea11e1d6c216458019e718e SHA1 a63a6eee419dac265164a6579b7cd1ecce548787 SHA256 e7bc45fabba2060403ae0c5d5f822a1095c32543afc3078b91ad8fe4ac6d607b AUX gnat.eselect-1.3 5309 RMD160 86e9172a9fff2d05961ec858383ec410f2f7f67a SHA1 4e1f8451c96d46e2f1a4017e6faf476cfb1e7dae SHA256 7474707a58cfe8e9714fd5e5982cb7fac8356927452487331d2051c3c0ff673e -EBUILD eselect-gnat-0.9.ebuild 636 RMD160 3a337cd38dbc36f91e41b311eef9fd8c0207e67f SHA1 f712a79ad8ccb81af7b0e3df8452abf679ad60ea SHA256 c0e771e30fb3704f93ac45ac51a50bdf3428d3d2d20f52a5a8dc00a4becf02eb -EBUILD eselect-gnat-1.0-r1.ebuild 578 RMD160 9b49f025c5e6320d7a24c82e18d9f9d9240265cd SHA1 89e3740049a17a3d3ea37dc63ca32e409b042fcf SHA256 aac613fe1fb32561f9acd904506d86773f68d5d2cb0d3fd647628fc3dbc2c958 -EBUILD eselect-gnat-1.0.ebuild 636 RMD160 c0f70bc8eefc7b73c86027f5abdd0c3e21453b35 SHA1 5aec4d13fa8f91eaa87efc6eb4885412cb17b7e8 SHA256 bfae925872974b16698374e8198b9946583f748d0992a36f282f8ded5be90526 -EBUILD eselect-gnat-1.1-r1.ebuild 769 RMD160 4c4010709fc0b0c4d8fbe5fb67eac4eb95791955 SHA1 bc04823eabc689897c28f9de96e13017e4be4963 SHA256 3d1ba618fca7d0d0e86744080c5a02d0135a2e4e17bf19b995360c0894b62002 -EBUILD eselect-gnat-1.1.ebuild 766 RMD160 9b44df397d59fbf288a29ec6624e916db205a4e6 SHA1 5497c35bab0112feddb2d47f7f736c1c95357bcf SHA256 abfc32da8ae1f75a34084536601bf6534b32fabe7ee64ef7b4b1d4d2a26a3da2 EBUILD eselect-gnat-1.2.ebuild 792 RMD160 69ab712fbb9766de7353e5e8469dee4292f76aca SHA1 92ef4bc71db44705b938723e653b89566d3ce4c9 SHA256 d0018f3b317c87389086f36d50fcc7c8ae3079191379a75801a42dde8a42de75 EBUILD eselect-gnat-1.3-r1.ebuild 791 RMD160 78814b6bf0d5513889b93bae6334d9e6e76fca5e SHA1 026f3b70e6059e0d4cc494e5e9d14e1cff900e5a SHA256 3a4b17f4b805ae14dfb060c8e412df027cad404010c3f9eed9fe46bbdaad630d -EBUILD eselect-gnat-1.3.ebuild 791 RMD160 97dc5f0b96195f433ae32c7ff6ffcb25830909c1 SHA1 a2e3fd854ed59ab07370a3f6b7858ad91d67ef5f SHA256 81650e561be89188fbd4ea932d0b95b630f8499cdbddbb052d9c769e22992fc0 -MISC ChangeLog 4310 RMD160 3f18ca488e160dcc2b30bedee34ff1effe28128d SHA1 6f4ac55b1c409e54ed97b742ff0844876518a6e7 SHA256 2abb0787fa245d059ae610042223d0c17aff0326563d57e03abd111c57cb6251 +MISC ChangeLog 4753 RMD160 c39f3eaf5781ee159c7dd79d4543822122c2e00c SHA1 d88b73aab1ef01a1a1472e847e3ce86ee8b8db96 SHA256 284f7a38860d5f0c362906a6feb6b30f6626229e8c0f6382dec186c9f6a5caf2 MISC metadata.xml 244 RMD160 784e7fb6660b05dbdd027b1e23975e26e72b7a39 SHA1 e2df521788bf35a7cf98d8b44adca1a1b03df544 SHA256 c32a1e42a5f85acb0b69af3e2644f98213d48492817c90a82c833927d2881419 diff --git a/app-admin/eselect-gnat/eselect-gnat-0.9.ebuild b/app-admin/eselect-gnat/eselect-gnat-0.9.ebuild deleted file mode 100644 index 4c34b2a45281..000000000000 --- a/app-admin/eselect-gnat/eselect-gnat-0.9.ebuild +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright 1999-2007 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-admin/eselect-gnat/eselect-gnat-0.9.ebuild,v 1.2 2007/12/11 23:46:45 george Exp $ - -inherit eutils - -DESCRIPTION="gnat module for eselect." -HOMEPAGE="http://www.gentoo.org" -SRC_URI="" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~amd64 ~ppc ~x86" - -IUSE="" -RDEPEND="app-admin/eselect" - -MODULEDIR="/usr/share/eselect/modules" - -src_install() { - dodir ${MODULEDIR} - insinto ${MODULEDIR} - doins "${FILESDIR}"/gnat.eselect-${PVR} - mv "${D}${MODULEDIR}"/gnat.eselect-${PVR} "${D}${MODULEDIR}"/gnat.eselect -} diff --git a/app-admin/eselect-gnat/eselect-gnat-1.0-r1.ebuild b/app-admin/eselect-gnat/eselect-gnat-1.0-r1.ebuild deleted file mode 100644 index d816830bb4a0..000000000000 --- a/app-admin/eselect-gnat/eselect-gnat-1.0-r1.ebuild +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright 1999-2007 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-admin/eselect-gnat/eselect-gnat-1.0-r1.ebuild,v 1.2 2007/12/11 23:46:45 george Exp $ - -inherit eutils - -DESCRIPTION="gnat module for eselect." -HOMEPAGE="http://www.gentoo.org" -SRC_URI="" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~amd64 ~ppc ~x86" - -IUSE="" -RDEPEND="app-admin/eselect" - -MODULEDIR="/usr/share/eselect/modules" - -src_install() { - dodir ${MODULEDIR} - insinto ${MODULEDIR} - newins "${FILESDIR}"/gnat.eselect-${PVR} gnat.eselect -} diff --git a/app-admin/eselect-gnat/eselect-gnat-1.0.ebuild b/app-admin/eselect-gnat/eselect-gnat-1.0.ebuild deleted file mode 100644 index 75c99dbed1f5..000000000000 --- a/app-admin/eselect-gnat/eselect-gnat-1.0.ebuild +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright 1999-2007 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-admin/eselect-gnat/eselect-gnat-1.0.ebuild,v 1.2 2007/12/11 23:46:45 george Exp $ - -inherit eutils - -DESCRIPTION="gnat module for eselect." -HOMEPAGE="http://www.gentoo.org" -SRC_URI="" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~amd64 ~ppc ~x86" - -IUSE="" -RDEPEND="app-admin/eselect" - -MODULEDIR="/usr/share/eselect/modules" - -src_install() { - dodir ${MODULEDIR} - insinto ${MODULEDIR} - doins "${FILESDIR}"/gnat.eselect-${PVR} - mv "${D}${MODULEDIR}"/gnat.eselect-${PVR} "${D}${MODULEDIR}"/gnat.eselect -} diff --git a/app-admin/eselect-gnat/eselect-gnat-1.1-r1.ebuild b/app-admin/eselect-gnat/eselect-gnat-1.1-r1.ebuild deleted file mode 100644 index b3185899477b..000000000000 --- a/app-admin/eselect-gnat/eselect-gnat-1.1-r1.ebuild +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright 1999-2007 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-admin/eselect-gnat/eselect-gnat-1.1-r1.ebuild,v 1.1 2007/12/11 23:46:45 george Exp $ - -inherit eutils - -DESCRIPTION="gnat module for eselect." -HOMEPAGE="http://www.gentoo.org" -SRC_URI="" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~amd64 ~ppc ~x86" - -IUSE="" -RDEPEND="app-admin/eselect" - -MODULEDIR="/usr/share/eselect/modules" - -# NOTE!! -# This path is duplicated in gnat-eselect module, -# adjust in both locations! -LIBDIR="/usr/share/gnat/lib" - -src_install() { - dodir ${MODULEDIR} - insinto ${MODULEDIR} - newins "${FILESDIR}"/gnat.eselect-${PVR} gnat.eselect - dodir ${LIBDIR} - insinto ${LIBDIR} - doins "${FILESDIR}"/gnat-common.bash -} diff --git a/app-admin/eselect-gnat/eselect-gnat-1.1.ebuild b/app-admin/eselect-gnat/eselect-gnat-1.1.ebuild deleted file mode 100644 index 263c4abcf7c9..000000000000 --- a/app-admin/eselect-gnat/eselect-gnat-1.1.ebuild +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright 1999-2007 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-admin/eselect-gnat/eselect-gnat-1.1.ebuild,v 1.2 2007/12/11 23:46:45 george Exp $ - -inherit eutils - -DESCRIPTION="gnat module for eselect." -HOMEPAGE="http://www.gentoo.org" -SRC_URI="" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~amd64 ~ppc ~x86" - -IUSE="" -RDEPEND="app-admin/eselect" - -MODULEDIR="/usr/share/eselect/modules" - -# NOTE!! -# This path is duplicated in gnat-eselect module, -# adjust in both locations! -LIBDIR="/usr/share/gnat/lib" - -src_install() { - dodir ${MODULEDIR} - insinto ${MODULEDIR} - newins "${FILESDIR}"/gnat.eselect-${PVR} gnat.eselect - dodir ${LIBDIR} - insinto ${LIBDIR} - doins "${FILESDIR}"/gnat-common.bash -} diff --git a/app-admin/eselect-gnat/eselect-gnat-1.3.ebuild b/app-admin/eselect-gnat/eselect-gnat-1.3.ebuild deleted file mode 100644 index fa7dc69224f0..000000000000 --- a/app-admin/eselect-gnat/eselect-gnat-1.3.ebuild +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright 1999-2007 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-admin/eselect-gnat/eselect-gnat-1.3.ebuild,v 1.1 2007/12/26 22:03:13 george Exp $ - -inherit eutils - -DESCRIPTION="gnat module for eselect." -HOMEPAGE="http://www.gentoo.org" -SRC_URI="" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~amd64 ~ppc ~x86" - -IUSE="" -RDEPEND="app-admin/eselect" - -MODULEDIR="/usr/share/eselect/modules" - -# NOTE!! -# This path is duplicated in gnat-eselect module, -# adjust in both locations! -LIBDIR="/usr/share/gnat/lib" - -src_install() { - dodir ${MODULEDIR} - insinto ${MODULEDIR} - newins "${FILESDIR}"/gnat.eselect-${PVR} gnat.eselect - dodir ${LIBDIR} - insinto ${LIBDIR} - newins "${FILESDIR}"/gnat-common-${PVR}.bash gnat-common.bash -} diff --git a/app-admin/eselect-gnat/files/gnat-common-1.3.bash b/app-admin/eselect-gnat/files/gnat-common-1.3.bash deleted file mode 100644 index 8d96b50c111f..000000000000 --- a/app-admin/eselect-gnat/files/gnat-common-1.3.bash +++ /dev/null @@ -1,218 +0,0 @@ -# Copyright 1999-2007 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-admin/eselect-gnat/files/gnat-common-1.3.bash,v 1.1 2007/12/26 22:03:13 george Exp $ - -# -# Original Author: George Shapovalov <george@gentoo.org> -# Purpose: Contains common vars/locations and functions for use by gnat.eclass, -# gnat.eselect and gnatbuild.eclass. -# -# NOTE!!! -# This code should just define vars (try to limit these!) and simple functions. -# No bash extensions!! -# That is, no portage or eclass constructs are allowed! -# - - - -# ---------------------------------- -# Globals - -# Environmantal stuff (for env update) -SPECSDIR="/usr/share/gnat/eselect" -ENVDIR="/etc/env.d" -MARKER="55gnat-" - -# User configurable settings -SETTINGSDIR="/etc/ada" -PRIMELIST="${SETTINGSDIR}/primary_compilers" - -## Lib install locations -## -## Gnat profile dependent files go under under ${LibTop}/${Gnat_Profile}/${PN} -## and common files go unde SpecsDir, DataDir -#PREFIX=/usr -## Replace %LIBDIR% below with $(get_libdir) in eclasses and ebuilds (top level Ok, inherit multilib) -## or $(profile2libdir ${profile}) in this code, eselect module or anywhere -## outside portage (as profile will be available only during actual execution, this only should -## be done inside corresponding functions). -#AdalibSpecsDir=${PREFIX}/include/ada -#AdalibDataDir=${PREFIX}/share/ada -#AdalibLibTop=${PREFIX}/%LIBDIR%/ada - - -# ------------------------------------ -# Helpers -# - -# get_all_profile_components splits gnat profile and returns pace separated list of its components: -# x86_64-pc-linux-gnu-gnat-gcc-4.1 -> x86_64-pc-linux-gnu gcc 4.1 -# args: -# $1 - the string to split -get_all_profile_components() { - local GnatSLOT=${1##*-} - local remainder=${1%-*} - local GnatPkg=${remainder##*-} - remainder=${remainder%-gnat-*} - echo "${remainder} ${GnatPkg} ${GnatSLOT}" -} - -# similar to above, returns only SLOT component: -# x86_64-pc-linux-gnu-gnat-gcc-4.1 -> 4.1 -# args: -# $1 - the string to extract the slot from -get_gnat_SLOT() { - echo "${1##*-}" -} - -# returns only Pkg component: -# x86_64-pc-linux-gnu-gnat-gcc-4.1 -> gcc -# args: -# $1 - the string to extract the slot from -get_gnat_Pkg() { - local remainder=${1%-*} - echo "${remainder##*-}" -} - -# returns only Arch component: -# x86_64-pc-linux-gnu-gnat-gcc-4.1 -> x86_64-pc-linux-gnu -# args: -# $1 - the string to extract the slot from -get_gnat_Arch() { - echo ${1%-gnat-*} -} - - - -## ------------------------------------------- -# gnat profile and lib detection functions - - -# create a list of all gnat env.d files -# for now use trivial implementation - store name of active profile in the -# env file name, so it gets called 55gnat-${ARCH}-${PN}-${SLOT} -get_env_list() { - for fn in ${ENVDIR}/${MARKER}*; do - echo $(basename ${fn}) - done -} - - - -# find all installed compilers and return a list -find_all_compilers() { - [[ ! -d ${SPECSDIR} ]] && exit - for fn in ${SPECSDIR}/*; do - [[ ! -d ${fn} ]] && echo $(basename ${fn}); - done -} - -# find installed primary compilers and return a list -find_primary_compilers() { - [[ ! -f ${PRIMELIST} ]] && exit - for fn in $(cat ${PRIMELIST}); do - [[ -f ${SPECSDIR}/${fn} ]] && echo ${fn}; - done -} - -# find installed libs and return a list -find_all_libs() { - [[ ! -d ${SPECSDIR} ]] && exit - for fn in ${SPECSDIR}/*; do - [[ -d ${fn} ]] && echo $(basename ${fn}); - done -} - -# find libs that have been built for a given profile -# Arguments: -# $1 - gnat profile for which to detect active libs -find_libs4profile() { - libs=( $(find_all_libs) ) - - for (( i = 0 ; i < ${#libs[@]} ; i = i + 1 )) ; do - [[ -f ${SPECSDIR}/${libs[$i]}/$1 ]] && echo "${libs[$i]}" - done -} - - - - -## ----------------------- -# main action - central part of do_set and helpers - - -# extracts values of the passed var definition from given spec file -# params: -# $1: spec file (as generated by gnabuild.eclass) -# $2: variable name -get_var_from_spec() { - local var=$(grep -e "^ *$2=" $1|cut -d= -f2) - echo ${var} -} - - -# Cycle through given libs and form a ':' separated list of settings for the given -# var. Returned string starts with ':' if there is any non-empty setting, -# otherwise returns empty string. Repeating settings are omitted, that is -# unique entry is added only first time it is encountered. No need to have some -# common dir listed many times in PATH for example. -# -# params: -# $1 - name of env var to process -# $2 - name of gnat profile -# $3.. - list of libs to check (to avoid its composition every time) -# - the list is expanded to list of args at the point of call -get_lib_var_settings() { - local envVar=$1 - local toset=$2 - #echo "get_lib_var_settings params:$@" >> /tmp/eselect-gnat.rep - if [[ "none" != ${3} ]]; then - local envString - local specLine - while [[ -n $3 ]]; do - specLine=$(get_var_from_spec ${SPECSDIR}/$3/${toset} ${envVar}) - #echo "$3:${specLine}." >> /tmp/eselect-gnat.rep - if [[ -n ${specLine} ]] && [[ ! ${envString} =~ ${specLine} ]]; then - envString="${envString}:${specLine}" - fi - shift - done - echo "${envString}" - fi -} - - - -# The action! -# Part common for do_set and do_update of gnat.eselect, also used in gnat.eclass -# to set environment during lib build and installation -# -# params: -# $1 - profile to set (toset param inside) -# $2 - envfile - -generate_envFile() { - local toset=$1 - local envfile=$2 - - local binpath="$(get_var_from_spec ${SPECSDIR}/${toset} binpath)" - local libexecpath="$(get_var_from_spec ${SPECSDIR}/${toset} libexecpath)" - local libs=( $(find_libs4profile ${toset}) ) - #echo "generate_envFile: ${libs[@]}" >> /tmp/eselect-gnat.rep - if (( 0 == ${#libs[@]} )); then - libs="none" - fi - - local MyPath="${binpath}:${libexecpath}$(get_lib_var_settings PATH ${toset} ${libs[@]})" - echo "PATH=${MyPath}" > "${envfile}" - echo "ROOTPATH=${MyPath}" >> "${envfile}" - echo "MANPATH=$(get_var_from_spec ${SPECSDIR}/${toset} manpath)$(get_lib_var_settings MANPATH ${toset} ${libs[@]})" >> "${envfile}" - echo "INFOPATH=$(get_var_from_spec ${SPECSDIR}/${toset} infopath)$(get_lib_var_settings INFOPATH ${toset} ${libs[@]})" >> "${envfile}" - # the next three use the common base - local libBase=$(get_var_from_spec ${SPECSDIR}/${toset} ldpath) - echo "LDPATH=${libBase}:${libBase}/adalib$(get_lib_var_settings LDPATH ${toset} ${libs[@]})" >> "${envfile}" - echo "ADA_INCLUDE_PATH=${libBase}/adainclude$(get_lib_var_settings ADA_INCLUDE_PATH ${toset} ${libs[@]})" >> "${envfile}" - echo "ADA_OBJECTS_PATH=${libBase}/adalib$(get_lib_var_settings ADA_OBJECTS_PATH ${toset} ${libs[@]})" >> "${envfile}" - echo "ADA_PROJECT_PATH=$(get_lib_var_settings ADA_PROJECT_PATH ${toset} ${libs[@]})" >> "${envfile}" -} - diff --git a/app-admin/eselect-gnat/files/gnat-common.bash b/app-admin/eselect-gnat/files/gnat-common.bash deleted file mode 100644 index 2333b5967b57..000000000000 --- a/app-admin/eselect-gnat/files/gnat-common.bash +++ /dev/null @@ -1,187 +0,0 @@ -# Copyright 1999-2007 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-admin/eselect-gnat/files/gnat-common.bash,v 1.2 2007/09/25 21:06:55 george Exp $ - -# -# Original Author: George Shapovalov <george@gentoo.org> -# Purpose: Contains common vars/locations and functions for use by gnat.eclass, -# gnat.eselect and gnatbuild.eclass. -# -# NOTE!!! -# This eclass should just define vars (tyr to limit these!) and simple functions. -# No bash extensions!! -# That is, no portage or eclass internals are allowed! -# - - - -# ---------------------------------- -# Globals - -# Environmantal stuff (for env update) -SPECSDIR="/usr/share/gnat/eselect" -ENVDIR="/etc/env.d" -MARKER="55gnat-" - - -# ------------------------------------ -# Helpers -# - -# get_all_profile_components splits gnat profile and returns pace separated list of its components: -# x86_64-pc-linux-gnu-gnat-gcc-4.1 -> x86_64-pc-linux-gnu gcc 4.1 -# args: -# $1 - the string to split -get_all_profile_components() { - local GnatSLOT=${1##*-} - local remainder=${1%-*} - local GnatPkg=${remainder##*-} - remainder=${remainder%-gnat-*} - echo "${remainder} ${GnatPkg} ${GnatSLOT}" -} - -# similar to above, returns only SLOT component: -# x86_64-pc-linux-gnu-gnat-gcc-4.1 -> 4.1 -# args: -# $1 - the string to extract the slot from -get_gnat_SLOT() { - echo "${1##*-}" -} - -# returns only Pkg component: -# x86_64-pc-linux-gnu-gnat-gcc-4.1 -> gcc -# args: -# $1 - the string to extract the slot from -get_gnat_Pkg() { - local remainder=${1%-*} - echo "${remainder##*-}" -} - -# returns only Arch component: -# x86_64-pc-linux-gnu-gnat-gcc-4.1 -> x86_64-pc-linux-gnu -# args: -# $1 - the string to extract the slot from -get_gnat_Arch() { - echo ${1%-gnat-*} -} - - - -## ------------------------------------------- -# gnat profile and lib detection functions - - -# create a list of all gnat env.d files -# for now use trivial implementation - store name of active profile in the -# env file name, so it gets called 55gnat-${ARCH}-${PN}-${SLOT} -get_env_list() { - for fn in ${ENVDIR}/${MARKER}*; do - echo $(basename ${fn}) - done -} - - - -# find installed compilers and return a list -find_compilers() { - [ ! -d ${SPECSDIR} ] && exit - for fn in ${SPECSDIR}/*; do - [ ! -d ${fn} ] && echo $(basename ${fn}); - done -} - -# find installed libs and return a list -find_all_libs() { - [ ! -d ${SPECSDIR} ] && exit - for fn in ${SPECSDIR}/*; do - [ -d ${fn} ] && echo $(basename ${fn}); - done -} - -# find libs that have been built for a given profile -# Arguments: -# $1 - gnat profile for which to detect active libs -find_libs4profile() { - libs=( $(find_all_libs) ) - - for (( i = 0 ; i < ${#libs[@]} ; i = i + 1 )) ; do - [ -f ${SPECSDIR}/${libs[$i]}/$1 ] && echo "${libs[$i]}" - done -} - - - - -## ----------------------- -# princial action - central part of do_set and helpers - - -# extracts values of the passed var definition from given spec file -# params: -# $1: spec file (as generated by gnabuild.eclass) -# $2: variable name -get_var_from_spec() { - local var=$(grep -e "^ *$2=" $1|cut -d= -f2) - echo ${var} -} - - -# Cycle through given libs and form a ':' separated list of settings for the given -# var. Returned string starts with ':' if there is any non-empty setting, -# otherwise returns empty string -# params: -# $1 - name of env var to process -# $2 - name of gnat profile -# $3.. - list of libs to check (to avoid its composition every time) -# - the list is expanded to lest of args at the point of call -get_lib_var_settings() { - local envVar=$1 - local toset=$2 - #echo "get_lib_var_settings params:$@" >> /tmp/eselect-gnat.rep - if [[ "none" != ${3} ]]; then - local envString - local specLine - while [[ -n $3 ]]; do - specLine=$(get_var_from_spec ${SPECSDIR}/$3/${toset} ${envVar}) - #echo "$3:${specLine}." >> /tmp/eselect-gnat.rep - [[ -n ${specLine} ]] && envString="${envString}:${specLine}" - shift - done - echo "${envString}" - fi -} - - - -# The action! -# Part common for do_set and do_update of gnat.eselect, also used in gnat.eclass -# to set environment during lib build and installation -# -# params: -# $1 - profile to set (toset param inside) -# $2 - envfile - -generate_envFile() { - local toset=$1 - local envfile=$2 - - local binpath="$(get_var_from_spec ${SPECSDIR}/${toset} binpath)" - local libexecpath="$(get_var_from_spec ${SPECSDIR}/${toset} libexecpath)" - local libs=( $(find_libs4profile ${toset}) ) - #echo "generate_envFile: ${libs[@]}" >> /tmp/eselect-gnat.rep - if (( 0 == ${#libs[@]} )); then - libs="none" - fi - - local MyPath="${binpath}:${libexecpath}$(get_lib_var_settings PATH ${toset} ${libs[@]})" - echo "PATH=${MyPath}" > "${envfile}" - echo "ROOTPATH=${MyPath}" >> "${envfile}" - echo "MANPATH=$(get_var_from_spec ${SPECSDIR}/${toset} manpath)$(get_lib_var_settings MANPATH ${toset} ${libs[@]})" >> "${envfile}" - echo "INFOPATH=$(get_var_from_spec ${SPECSDIR}/${toset} infopath)$(get_lib_var_settings INFOPATH ${toset} ${libs[@]})" >> "${envfile}" - # the next three use the common base - local libBase=$(get_var_from_spec ${SPECSDIR}/${toset} ldpath) - echo "LDPATH=${libBase}:${libBase}/adalib$(get_lib_var_settings LDPATH ${toset} ${libs[@]})" >> "${envfile}" - echo "ADA_INCLUDE_PATH=${libBase}/adainclude$(get_lib_var_settings ADA_INCLUDE_PATH ${toset} ${libs[@]})" >> "${envfile}" - echo "ADA_OBJECTS_PATH=${libBase}/adalib$(get_lib_var_settings ADA_OBJECTS_PATH ${toset} ${libs[@]})" >> "${envfile}" -} - diff --git a/app-admin/eselect-gnat/files/gnat.eselect-0.9 b/app-admin/eselect-gnat/files/gnat.eselect-0.9 deleted file mode 100644 index 8a14aa9673d2..000000000000 --- a/app-admin/eselect-gnat/files/gnat.eselect-0.9 +++ /dev/null @@ -1,300 +0,0 @@ -# Copyright 1999-2005 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Id: gnat.eselect-0.9,v 1.2 2007/09/07 13:31:07 george Exp $ - -DESCRIPTION="Manage the installed gnat compilers" -MAINTAINER="ada@gentoo.org" -SVN_DATE='$Date: 2007/09/07 13:31:07 $' -VERSION=$(svn_date_to_version "${SVN_DATE}" ) - -SPECSDIR="/usr/share/gnat/eselect" -ENVDIR="/etc/env.d" -MARKER="55gnat-" -#LibMarker="56" - -### Phylosophy -# Each gnat installs a "specs" file named ${ARCH}-${PN}-${SLOT} under ${SPECSDIR} -# Each lib creates a dir with its name under ${SPECSDIR} and populates it with -# similar specs files (same name scheme) -# Recognizing gnat specs from lib specs is then eazy - test entry for being a -# dir, then just check what gnat profiles are installed for each lib.. -# doset then creates env file that combines settings for gnat and for the -# corresponding profile of each installed lib.. - - -### Helpers - -# create a list of all gnat env.d files -# for now use trivial implementation - store name of active profile in the -# env file name, so it gets called 55gnat-${ARCH}-${PN}-${SLOT} -get_env_list() { - for fn in ${ENVDIR}/${MARKER}*; do - echo $(basename ${fn}) - done -} - -# return *the* name of the active profile, checking that we do not have multiple -# env files. -# There can be only one! -get_current_gnat() { - local profiles=( $(get_env_list) ) - - if [ ${profiles[@]} == "${MARKER}*" ]; then exit; fi - - if (( 1 == ${#profiles[@]} )); then - local active=${profiles[0]#${MARKER}} - else - die -q "${ENVDIR} contains multiple gnat profiles, please cleanup!" - fi - - if [ -f ${SPECSDIR}/${active} ]; then - echo ${active} - else - die -q "the active env.d profile does not correspond to any installed gnat!" - fi -} - -# find installed compilers and return a list -find_compilers() { - [ ! -d ${SPECSDIR} ] && exit - for fn in ${SPECSDIR}/*; do - [ ! -d ${fn} ] && echo $(basename ${fn}); - done -} - -# find installed libs and return a list -find_all_libs() { - [ ! -d ${SPECSDIR} ] && exit - for fn in ${SPECSDIR}/*; do - [ -d ${fn} ] && echo $(basename ${fn}); - done -} - -# find libs that have been built for a given profile -# Arguments: -# $1 - gnat profile for which to detect active libs -find_libs4profile() { - libs=( $(find_all_libs) ) - - for (( i = 0 ; i < ${#libs[@]} ; i = i + 1 )) ; do - [ -f ${SPECSDIR}/${libs[$i]}/$1 ] && echo "${libs[$i]}" - done -} - -# check if the passed arg represents the installed gnat and return it or -# not_found -# takes args: -# $1 - list ID to check -get_name_from_list() { - compiler=$1 - - compilers=( $(find_compilers) ) - for (( i = 0 ; i < ${#compilers[@]} ; i = i + 1 )) ; do - if [[ ${compilers[$i]} == ${compiler} ]] ; then - echo ${compiler} - return - fi - done - - echo "(not-found)" -} - - -# extracts values of the passed var definition from given spec file -# params: -# $1: spec file (as generated by gnabuild.eclass) -# $2: variable name -get_var_from_spec() { - local var=$(grep -e "^ *$2=" $1|cut -d= -f2) - echo ${var} -} - - -# Cycle through given libs and form a : separated list of settings for the given -# var. Returned string starts with ":" if there is any non-empty setting, -# otherwise returns empty string -# params: -# $1 - name of env var to process -# $2 - name of gnat profile -# $3.. - list of libs to check (to avoid its composition every time) -# - the list is expanded to lest of args at the point of call -get_lib_var_settings() { - local envVar=$1 - local toset=$2 - #echo "get_lib_var_settings params:$@" >> /tmp/eselect-gnat.rep - if [[ "none" != ${3} ]]; then - local envString - local specLine - while [[ -n $3 ]]; do - specLine=$(get_var_from_spec ${SPECSDIR}/$3/${toset} ${envVar}) - #echo "$3:${specLine}." >> /tmp/eselect-gnat.rep - [[ -n ${specLine} ]] && envString="${envString}:${specLine}" - shift - done - echo "${envString}" - fi -} - - -# removes env files (for compiler and libs) -# params: -# $1: the name of profile for which to remove env file -unset_env() { - rm -f ${ENVDIR}/${MARKER}$1 &> /dev/null -} - - -# Stuff common for do_set and do_update -# -# params: -# $1 - profile to set (toset param inside) -# $2 - envfile - -generate_envFile() { - local toset=$1 - local envfile=$2 - - local binpath="$(get_var_from_spec ${SPECSDIR}/${toset} binpath)" - local libexecpath="$(get_var_from_spec ${SPECSDIR}/${toset} libexecpath)" - local libs=( $(find_libs4profile ${toset}) ) - #echo "generate_envFile: ${libs[@]}" >> /tmp/eselect-gnat.rep - if (( 0 == ${#libs[@]} )); then - libs="none" - fi - - local MyPath="${binpath}:${libexecpath}$(get_lib_var_settings PATH ${toset} ${libs[@]})" - echo "PATH=${MyPath}" > "${envfile}" - echo "ROOTPATH=${MyPath}" >> "${envfile}" - echo "MANPATH=$(get_var_from_spec ${SPECSDIR}/${toset} manpath)$(get_lib_var_settings MANPATH ${toset} ${libs[@]})" >> "${envfile}" - echo "INFOPATH=$(get_var_from_spec ${SPECSDIR}/${toset} infopath)$(get_lib_var_settings INFOPATH ${toset} ${libs[@]})" >> "${envfile}" - echo "LDPATH=$(get_var_from_spec ${SPECSDIR}/${toset} ldpath)$(get_lib_var_settings LDPATH ${toset} ${libs[@]})" >> "${envfile}" - echo "ADA_INCLUDE_PATH=$(get_var_from_spec ${SPECSDIR}/${toset} ldpath)/adainclude$(get_lib_var_settings ADA_INCLUDE_PATH ${toset} ${libs[@]})" >> "${envfile}" - echo "ADA_OBJECTS_PATH=$(get_var_from_spec ${SPECSDIR}/${toset} ldpath)/adalib$(get_lib_var_settings ADA_OBJECTS_PATH ${toset} ${libs[@]})" >> "${envfile}" -} - -### show action ### - -describe_show() { - echo "Show the active gnat compiler/profile and installed libs" -} - -do_show() { - write_list_start "Current gnat version:" - active=$(get_current_gnat) - if [ ! -z ${active} ] ; then # not sure why [ -n ] does not do the same - write_kv_list_entry "$active" "" - libs=( $(find_libs4profile ${active}) ) - write_list_start "Active libs:" - write_numbered_list "${libs[@]}" - else - write_kv_list_entry "(none set)" "" - fi -} - -### list action ### - -describe_list() { - echo "List installed gnat compilers and libs" -} - -do_list() { - compilers=( $(find_compilers ) ) - active=$(get_current_gnat) - - write_list_start "Available gnat compilers:" - - if [[ -n ${compilers[@]} ]] ; then - local i - for (( i = 0 ; i < ${#compilers[@]} ; i = i + 1 )) ; do - linkversion=${compilers[${i}]} - - [[ $linkversion == $active ]] && \ - compilers[${i}]="${compilers[${i}]} $(highlight '*' )" - done - write_numbered_list "${compilers[@]}" - - # now the libs - libs=( $(find_all_libs) ) - write_list_start "Installed libs:" - for (( i = 0 ; i < ${#libs[@]} ; i = i + 1 )) ; do - [ -f ${SPECSDIR}/${libs[$i]}/${active} ] && \ - libs[${i}]="${libs[${i}]} $(highlight '*' )" - done - write_numbered_list "${libs[@]}" - else - write_kv_list_entry "(none found)" "" - fi -} - - -### set action ### - -describe_set() { - echo "Set active gnat compiler" -} - -# The set action. Parameters: -# $1 - name of profile to set, obligatory, passed by eselect -# $2 - optional, name of env file to generate. Used from gnat.eclass. -do_set() { - if [[ -z ${1} ]] ; then - # no parameter - die -q "You didn't tell me which gnat to use" - fi - - local toset=$(get_name_from_list $1) - if [[ ${toset} == "(not-found)" ]] ; then - die -q "I don't recognise the selection" - fi - - # the action! - # in this implementation simply create an appropriate env file - local active=$(get_current_gnat) - if [[ -z ${2} ]] ; then - local envfile="${ENVDIR}/${MARKER}${toset}" - - # now we need to remove an old env file, which is guaranteed to - # be unique by get_current_gnat above - if [[ -n ${active} ]] ; then - unset_env ${active} - fi - # just for a good measure remove the one we are going to write - unset_env ${toset} - else - local envfile="$2" - fi - - generate_envFile ${toset} ${envfile} -} - - - -### update action ### -# -# This action regenerates the /etc/env.d file for the current profile. Basically -# the same as set, only it does not take any parameters. It should be called from ebuilds -# installing Ada libs - -describe_update() { - echo "Update active gnat profile picking up new libs." -} - -do_update() { - local toset=$(get_current_gnat) - local envfile="${ENVDIR}/${MARKER}${toset}" - generate_envFile ${toset} ${envfile} -} - -### unset action ### - -describe_unset() { - echo "Remove settings for currently active gnat" -} - -do_unset() { - local active=$(get_current_gnat) - # check whether we have any profile set before removing anything.. - if [[ -n ${active} ]] ; then - unset_env ${active} - fi -} diff --git a/app-admin/eselect-gnat/files/gnat.eselect-1.0 b/app-admin/eselect-gnat/files/gnat.eselect-1.0 deleted file mode 100644 index f41c08c9d889..000000000000 --- a/app-admin/eselect-gnat/files/gnat.eselect-1.0 +++ /dev/null @@ -1,306 +0,0 @@ -# Copyright 1999-2005 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Id: gnat.eselect-1.0,v 1.2 2007/09/07 13:31:07 george Exp $ - -DESCRIPTION="Manage the installed gnat compilers" -MAINTAINER="ada@gentoo.org" -SVN_DATE='$Date: 2007/09/07 13:31:07 $' -VERSION=$(svn_date_to_version "${SVN_DATE}" ) - -SPECSDIR="/usr/share/gnat/eselect" -ENVDIR="/etc/env.d" -MARKER="55gnat-" -#LibMarker="56" - -### Phylosophy -# Each gnat installs a "specs" file named ${ARCH}-${PN}-${SLOT} under ${SPECSDIR} -# Each lib creates a dir with its name under ${SPECSDIR} and populates it with -# similar specs files (same name scheme) -# Recognizing gnat specs from lib specs is then eazy - test entry for being a -# dir, then just check what gnat profiles are installed for each lib.. -# doset then creates env file that combines settings for gnat and for the -# corresponding profile of each installed lib.. - - -### Helpers - -# create a list of all gnat env.d files -# for now use trivial implementation - store name of active profile in the -# env file name, so it gets called 55gnat-${ARCH}-${PN}-${SLOT} -get_env_list() { - for fn in ${ENVDIR}/${MARKER}*; do - echo $(basename ${fn}) - done -} - -# return *the* name of the active profile, checking that we do not have multiple -# env files. -# There can be only one! -get_current_gnat() { - local profiles=( $(get_env_list) ) - - if [ ${profiles[@]} == "${MARKER}*" ]; then exit; fi - - if (( 1 == ${#profiles[@]} )); then - local active=${profiles[0]#${MARKER}} - else - die -q "${ENVDIR} contains multiple gnat profiles, please cleanup!" - fi - - if [ -f ${SPECSDIR}/${active} ]; then - echo ${active} - else - die -q "the active env.d profile does not correspond to any installed gnat!" - fi -} - -# find installed compilers and return a list -find_compilers() { - [ ! -d ${SPECSDIR} ] && exit - for fn in ${SPECSDIR}/*; do - [ ! -d ${fn} ] && echo $(basename ${fn}); - done -} - -# find installed libs and return a list -find_all_libs() { - [ ! -d ${SPECSDIR} ] && exit - for fn in ${SPECSDIR}/*; do - [ -d ${fn} ] && echo $(basename ${fn}); - done -} - -# find libs that have been built for a given profile -# Arguments: -# $1 - gnat profile for which to detect active libs -find_libs4profile() { - libs=( $(find_all_libs) ) - - for (( i = 0 ; i < ${#libs[@]} ; i = i + 1 )) ; do - [ -f ${SPECSDIR}/${libs[$i]}/$1 ] && echo "${libs[$i]}" - done -} - -# check if the passed arg represents the installed gnat and return it or -# not_found -# takes args: -# $1 - list ID to check -get_name_from_list() { - compiler=$1 - - compilers=( $(find_compilers) ) - for (( i = 0 ; i < ${#compilers[@]} ; i = i + 1 )) ; do - if [[ ${compilers[$i]} == ${compiler} ]] ; then - echo ${compiler} - return - fi - done - - echo "(not-found)" -} - - -# extracts values of the passed var definition from given spec file -# params: -# $1: spec file (as generated by gnabuild.eclass) -# $2: variable name -get_var_from_spec() { - local var=$(grep -e "^ *$2=" $1|cut -d= -f2) - echo ${var} -} - - -# Cycle through given libs and form a : separated list of settings for the given -# var. Returned string starts with ":" if there is any non-empty setting, -# otherwise returns empty string -# params: -# $1 - name of env var to process -# $2 - name of gnat profile -# $3.. - list of libs to check (to avoid its composition every time) -# - the list is expanded to lest of args at the point of call -get_lib_var_settings() { - local envVar=$1 - local toset=$2 - #echo "get_lib_var_settings params:$@" >> /tmp/eselect-gnat.rep - if [[ "none" != ${3} ]]; then - local envString - local specLine - while [[ -n $3 ]]; do - specLine=$(get_var_from_spec ${SPECSDIR}/$3/${toset} ${envVar}) - #echo "$3:${specLine}." >> /tmp/eselect-gnat.rep - [[ -n ${specLine} ]] && envString="${envString}:${specLine}" - shift - done - echo "${envString}" - fi -} - - -# removes env files (for compiler and libs) -# params: -# $1: the name of profile for which to remove env file -unset_env() { - rm -f ${ENVDIR}/${MARKER}$1 &> /dev/null -} - - -# Stuff common for do_set and do_update -# -# params: -# $1 - profile to set (toset param inside) -# $2 - envfile - -generate_envFile() { - local toset=$1 - local envfile=$2 - - local binpath="$(get_var_from_spec ${SPECSDIR}/${toset} binpath)" - local libexecpath="$(get_var_from_spec ${SPECSDIR}/${toset} libexecpath)" - local libs=( $(find_libs4profile ${toset}) ) - #echo "generate_envFile: ${libs[@]}" >> /tmp/eselect-gnat.rep - if (( 0 == ${#libs[@]} )); then - libs="none" - fi - - local MyPath="${binpath}:${libexecpath}$(get_lib_var_settings PATH ${toset} ${libs[@]})" - echo "PATH=${MyPath}" > "${envfile}" - echo "ROOTPATH=${MyPath}" >> "${envfile}" - echo "MANPATH=$(get_var_from_spec ${SPECSDIR}/${toset} manpath)$(get_lib_var_settings MANPATH ${toset} ${libs[@]})" >> "${envfile}" - echo "INFOPATH=$(get_var_from_spec ${SPECSDIR}/${toset} infopath)$(get_lib_var_settings INFOPATH ${toset} ${libs[@]})" >> "${envfile}" - echo "LDPATH=$(get_var_from_spec ${SPECSDIR}/${toset} ldpath)$(get_lib_var_settings LDPATH ${toset} ${libs[@]})" >> "${envfile}" - echo "ADA_INCLUDE_PATH=$(get_var_from_spec ${SPECSDIR}/${toset} ldpath)/adainclude$(get_lib_var_settings ADA_INCLUDE_PATH ${toset} ${libs[@]})" >> "${envfile}" - echo "ADA_OBJECTS_PATH=$(get_var_from_spec ${SPECSDIR}/${toset} ldpath)/adalib$(get_lib_var_settings ADA_OBJECTS_PATH ${toset} ${libs[@]})" >> "${envfile}" -} - -### show action ### - -describe_show() { - echo "Show the active gnat compiler/profile and installed libs" -} - -do_show() { - write_list_start "Current gnat version:" - active=$(get_current_gnat) - if [ ! -z ${active} ] ; then # not sure why [ -n ] does not do the same - write_kv_list_entry "$active" "" - libs=( $(find_libs4profile ${active}) ) - write_list_start "Active libs:" - write_numbered_list "${libs[@]}" - else - write_kv_list_entry "(none set)" "" - fi -} - -### list action ### - -describe_list() { - echo "List installed gnat compilers and libs" -} - -do_list() { - compilers=( $(find_compilers ) ) - active=$(get_current_gnat) - - write_list_start "Available gnat compilers:" - - if [[ -n ${compilers[@]} ]] ; then - local i - for (( i = 0 ; i < ${#compilers[@]} ; i = i + 1 )) ; do - linkversion=${compilers[${i}]} - - [[ $linkversion == $active ]] && \ - compilers[${i}]="${compilers[${i}]} $(highlight '*' )" - done - write_numbered_list "${compilers[@]}" - - # now the libs - libs=( $(find_all_libs) ) - write_list_start "Installed libs:" - for (( i = 0 ; i < ${#libs[@]} ; i = i + 1 )) ; do - [ -f ${SPECSDIR}/${libs[$i]}/${active} ] && \ - libs[${i}]="${libs[${i}]} $(highlight '*' )" - done - write_numbered_list "${libs[@]}" - else - write_kv_list_entry "(none found)" "" - fi -} - - -### set action ### - -describe_set() { - echo "Set active gnat compiler" -} - -# The set action. Parameters: -# $1 - name of profile to set, obligatory, passed by eselect -# $2 - optional, name of env file to generate. Used from gnat.eclass. -do_set() { - if [[ -z ${1} ]] ; then - # no parameter - die -q "You didn't tell me which gnat to use" - fi - - local toset=$(get_name_from_list $1) - if [[ ${toset} == "(not-found)" ]] ; then - die -q "I don't recognise the selection" - fi - - # the action! - # in this implementation simply create an appropriate env file - local active=$(get_current_gnat) - if [[ -z ${2} ]] ; then - local envfile="${ENVDIR}/${MARKER}${toset}" - - # now we need to remove an old env file, which is guaranteed to - # be unique by get_current_gnat above - if [[ -n ${active} ]] ; then - unset_env ${active} - fi - # just for a good measure remove the one we are going to write - unset_env ${toset} - else - local envfile="$2" - fi - - generate_envFile ${toset} ${envfile} - - # force update environment - # should be replaced with "do_action env update" when #172472 gets resolved - env-update &> /dev/null -} - - - -### update action ### -# -# This action regenerates the /etc/env.d file for the current profile. Basically -# the same as set, only it does not take any parameters. It should be called from ebuilds -# installing Ada libs - -describe_update() { - echo "Update active gnat profile picking up new libs." -} - -do_update() { - local toset=$(get_current_gnat) - local envfile="${ENVDIR}/${MARKER}${toset}" - generate_envFile ${toset} ${envfile} - env-update &> /dev/null -} - -### unset action ### - -describe_unset() { - echo "Remove settings for currently active gnat" -} - -do_unset() { - local active=$(get_current_gnat) - # check whether we have any profile set before removing anything.. - if [[ -n ${active} ]] ; then - unset_env ${active} - env-update &> /dev/null - fi -} diff --git a/app-admin/eselect-gnat/files/gnat.eselect-1.0-r1 b/app-admin/eselect-gnat/files/gnat.eselect-1.0-r1 deleted file mode 100644 index d842b9569f66..000000000000 --- a/app-admin/eselect-gnat/files/gnat.eselect-1.0-r1 +++ /dev/null @@ -1,308 +0,0 @@ -# Copyright 1999-2005 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Id: gnat.eselect-1.0-r1,v 1.2 2007/09/07 13:31:07 george Exp $ - -DESCRIPTION="Manage the installed gnat compilers" -MAINTAINER="ada@gentoo.org" -SVN_DATE='$Date: 2007/09/07 13:31:07 $' -VERSION=$(svn_date_to_version "${SVN_DATE}" ) - -SPECSDIR="/usr/share/gnat/eselect" -ENVDIR="/etc/env.d" -MARKER="55gnat-" -#LibMarker="56" - -### Phylosophy -# Each gnat installs a "specs" file named ${ARCH}-${PN}-${SLOT} under ${SPECSDIR} -# Each lib creates a dir with its name under ${SPECSDIR} and populates it with -# similar specs files (same name scheme) -# Recognizing gnat specs from lib specs is then eazy - test entry for being a -# dir, then just check what gnat profiles are installed for each lib.. -# doset then creates env file that combines settings for gnat and for the -# corresponding profile of each installed lib.. - - -### Helpers - -# create a list of all gnat env.d files -# for now use trivial implementation - store name of active profile in the -# env file name, so it gets called 55gnat-${ARCH}-${PN}-${SLOT} -get_env_list() { - for fn in ${ENVDIR}/${MARKER}*; do - echo $(basename ${fn}) - done -} - -# return *the* name of the active profile, checking that we do not have multiple -# env files. -# There can be only one! -get_current_gnat() { - local profiles=( $(get_env_list) ) - - if [ ${profiles[@]} == "${MARKER}*" ]; then exit; fi - - if (( 1 == ${#profiles[@]} )); then - local active=${profiles[0]#${MARKER}} - else - die -q "${ENVDIR} contains multiple gnat profiles, please cleanup!" - fi - - if [ -f ${SPECSDIR}/${active} ]; then - echo ${active} - else - die -q "the active env.d profile does not correspond to any installed gnat!" - fi -} - -# find installed compilers and return a list -find_compilers() { - [ ! -d ${SPECSDIR} ] && exit - for fn in ${SPECSDIR}/*; do - [ ! -d ${fn} ] && echo $(basename ${fn}); - done -} - -# find installed libs and return a list -find_all_libs() { - [ ! -d ${SPECSDIR} ] && exit - for fn in ${SPECSDIR}/*; do - [ -d ${fn} ] && echo $(basename ${fn}); - done -} - -# find libs that have been built for a given profile -# Arguments: -# $1 - gnat profile for which to detect active libs -find_libs4profile() { - libs=( $(find_all_libs) ) - - for (( i = 0 ; i < ${#libs[@]} ; i = i + 1 )) ; do - [ -f ${SPECSDIR}/${libs[$i]}/$1 ] && echo "${libs[$i]}" - done -} - -# check if the passed arg represents the installed gnat and return it or -# not_found -# takes args: -# $1 - list ID to check -get_name_from_list() { - compiler=$1 - - compilers=( $(find_compilers) ) - for (( i = 0 ; i < ${#compilers[@]} ; i = i + 1 )) ; do - if [[ ${compilers[$i]} == ${compiler} ]] ; then - echo ${compiler} - return - fi - done - - echo "(not-found)" -} - - -# extracts values of the passed var definition from given spec file -# params: -# $1: spec file (as generated by gnabuild.eclass) -# $2: variable name -get_var_from_spec() { - local var=$(grep -e "^ *$2=" $1|cut -d= -f2) - echo ${var} -} - - -# Cycle through given libs and form a : separated list of settings for the given -# var. Returned string starts with ":" if there is any non-empty setting, -# otherwise returns empty string -# params: -# $1 - name of env var to process -# $2 - name of gnat profile -# $3.. - list of libs to check (to avoid its composition every time) -# - the list is expanded to lest of args at the point of call -get_lib_var_settings() { - local envVar=$1 - local toset=$2 - #echo "get_lib_var_settings params:$@" >> /tmp/eselect-gnat.rep - if [[ "none" != ${3} ]]; then - local envString - local specLine - while [[ -n $3 ]]; do - specLine=$(get_var_from_spec ${SPECSDIR}/$3/${toset} ${envVar}) - #echo "$3:${specLine}." >> /tmp/eselect-gnat.rep - [[ -n ${specLine} ]] && envString="${envString}:${specLine}" - shift - done - echo "${envString}" - fi -} - - -# removes env files (for compiler and libs) -# params: -# $1: the name of profile for which to remove env file -unset_env() { - rm -f ${ENVDIR}/${MARKER}$1 &> /dev/null -} - - -# Stuff common for do_set and do_update -# -# params: -# $1 - profile to set (toset param inside) -# $2 - envfile - -generate_envFile() { - local toset=$1 - local envfile=$2 - - local binpath="$(get_var_from_spec ${SPECSDIR}/${toset} binpath)" - local libexecpath="$(get_var_from_spec ${SPECSDIR}/${toset} libexecpath)" - local libs=( $(find_libs4profile ${toset}) ) - #echo "generate_envFile: ${libs[@]}" >> /tmp/eselect-gnat.rep - if (( 0 == ${#libs[@]} )); then - libs="none" - fi - - local MyPath="${binpath}:${libexecpath}$(get_lib_var_settings PATH ${toset} ${libs[@]})" - echo "PATH=${MyPath}" > "${envfile}" - echo "ROOTPATH=${MyPath}" >> "${envfile}" - echo "MANPATH=$(get_var_from_spec ${SPECSDIR}/${toset} manpath)$(get_lib_var_settings MANPATH ${toset} ${libs[@]})" >> "${envfile}" - echo "INFOPATH=$(get_var_from_spec ${SPECSDIR}/${toset} infopath)$(get_lib_var_settings INFOPATH ${toset} ${libs[@]})" >> "${envfile}" - # the next three use the common base - local libBase=$(get_var_from_spec ${SPECSDIR}/${toset} ldpath) - echo "LDPATH=${libBase}:${libBase}/adalib$(get_lib_var_settings LDPATH ${toset} ${libs[@]})" >> "${envfile}" - echo "ADA_INCLUDE_PATH=${libBase}/adainclude$(get_lib_var_settings ADA_INCLUDE_PATH ${toset} ${libs[@]})" >> "${envfile}" - echo "ADA_OBJECTS_PATH=${libBase}/adalib$(get_lib_var_settings ADA_OBJECTS_PATH ${toset} ${libs[@]})" >> "${envfile}" -} - -### show action ### - -describe_show() { - echo "Show the active gnat compiler/profile and installed libs" -} - -do_show() { - write_list_start "Current gnat version:" - active=$(get_current_gnat) - if [ ! -z ${active} ] ; then # not sure why [ -n ] does not do the same - write_kv_list_entry "$active" "" - libs=( $(find_libs4profile ${active}) ) - write_list_start "Active libs:" - write_numbered_list "${libs[@]}" - else - write_kv_list_entry "(none set)" "" - fi -} - -### list action ### - -describe_list() { - echo "List installed gnat compilers and libs" -} - -do_list() { - compilers=( $(find_compilers ) ) - active=$(get_current_gnat) - - write_list_start "Available gnat compilers:" - - if [[ -n ${compilers[@]} ]] ; then - local i - for (( i = 0 ; i < ${#compilers[@]} ; i = i + 1 )) ; do - linkversion=${compilers[${i}]} - - [[ $linkversion == $active ]] && \ - compilers[${i}]="${compilers[${i}]} $(highlight '*' )" - done - write_numbered_list "${compilers[@]}" - - # now the libs - libs=( $(find_all_libs) ) - write_list_start "Installed libs:" - for (( i = 0 ; i < ${#libs[@]} ; i = i + 1 )) ; do - [ -f ${SPECSDIR}/${libs[$i]}/${active} ] && \ - libs[${i}]="${libs[${i}]} $(highlight '*' )" - done - write_numbered_list "${libs[@]}" - else - write_kv_list_entry "(none found)" "" - fi -} - - -### set action ### - -describe_set() { - echo "Set active gnat compiler" -} - -# The set action. Parameters: -# $1 - name of profile to set, obligatory, passed by eselect -# $2 - optional, name of env file to generate. Used from gnat.eclass. -do_set() { - if [[ -z ${1} ]] ; then - # no parameter - die -q "You didn't tell me which gnat to use" - fi - - local toset=$(get_name_from_list $1) - if [[ ${toset} == "(not-found)" ]] ; then - die -q "I don't recognise the selection" - fi - - # the action! - # in this implementation simply create an appropriate env file - local active=$(get_current_gnat) - if [[ -z ${2} ]] ; then - local envfile="${ENVDIR}/${MARKER}${toset}" - - # now we need to remove an old env file, which is guaranteed to - # be unique by get_current_gnat above - if [[ -n ${active} ]] ; then - unset_env ${active} - fi - # just for a good measure remove the one we are going to write - unset_env ${toset} - else - local envfile="$2" - fi - - generate_envFile ${toset} ${envfile} - - # force update environment - # should be replaced with "do_action env update" when #172472 gets resolved - env-update &> /dev/null -} - - - -### update action ### -# -# This action regenerates the /etc/env.d file for the current profile. Basically -# the same as set, only it does not take any parameters. It should be called from ebuilds -# installing Ada libs - -describe_update() { - echo "Update active gnat profile picking up new libs." -} - -do_update() { - local toset=$(get_current_gnat) - local envfile="${ENVDIR}/${MARKER}${toset}" - generate_envFile ${toset} ${envfile} - env-update &> /dev/null -} - -### unset action ### - -describe_unset() { - echo "Remove settings for currently active gnat" -} - -do_unset() { - local active=$(get_current_gnat) - # check whether we have any profile set before removing anything.. - if [[ -n ${active} ]] ; then - unset_env ${active} - env-update &> /dev/null - fi -} diff --git a/app-admin/eselect-gnat/files/gnat.eselect-1.1 b/app-admin/eselect-gnat/files/gnat.eselect-1.1 deleted file mode 100644 index e58c58d4789e..000000000000 --- a/app-admin/eselect-gnat/files/gnat.eselect-1.1 +++ /dev/null @@ -1,207 +0,0 @@ -# Copyright 1999-2005 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Id: gnat.eselect-1.1,v 1.1 2007/09/19 20:24:05 george Exp $ - -DESCRIPTION="Manage the talled gnat compilers" -MAINTAINER="ada@gentoo.org" -SVN_DATE='$Date: 2007/09/19 20:24:05 $' -VERSION=$(svn_date_to_version "${SVN_DATE}" ) - -# "inheriting" common stuff -# this crude sourcing should be replaced by a call to function in -# libs/package-manager.bash eventually -. /usr/share/gnat/lib/gnat-common.bash - - -### Phylosophy -# Each gnat installs a "specs" file named ${ARCH}-${PN}-${SLOT} under ${SPECSDIR} -# Each lib creates a dir with its name under ${SPECSDIR} and populates it with -# similar specs files (same name scheme) -# Recognizing gnat specs from lib specs is then eazy - test entry for being a -# dir, then just check what gnat profiles are installed for each lib.. -# doset then creates env file that combines settings for gnat and for the -# corresponding profile of each installed lib.. - - -### Helpers - -# return *the* name of the active profile, checking that we do not have multiple -# env files. -# There can be only one! -get_current_gnat() { - local profiles=( $(get_env_list) ) - - if [ ${profiles[@]} == "${MARKER}*" ]; then exit; fi - - if (( 1 == ${#profiles[@]} )); then - local active=${profiles[0]#${MARKER}} - else - die -q "${ENVDIR} contains multiple gnat profiles, please cleanup!" - fi - - if [ -f ${SPECSDIR}/${active} ]; then - echo ${active} - else - die -q "the active env.d profile does not correspond to any installed gnat!" - fi -} - -# check if the passed arg represents the installed gnat and return it or -# not_found -# takes args: -# $1 - list ID to check -get_name_from_list() { - compiler=$1 - - compilers=( $(find_compilers) ) - for (( i = 0 ; i < ${#compilers[@]} ; i = i + 1 )) ; do - if [[ ${compilers[$i]} == ${compiler} ]] ; then - echo ${compiler} - return - fi - done - - echo "(not-found)" -} - - -# removes env files (for compiler and libs) -# params: -# $1: the name of profile for which to remove env file -unset_env() { - rm -f ${ENVDIR}/${MARKER}$1 &> /dev/null -} - - -### show action ### - -describe_show() { - echo "Show the active gnat compiler/profile and installed libs" -} - -do_show() { - write_list_start "Current gnat version:" - active=$(get_current_gnat) - if [ ! -z ${active} ] ; then # not sure why [ -n ] does not do the same - write_kv_list_entry "$active" "" - libs=( $(find_libs4profile ${active}) ) - write_list_start "Active libs:" - write_numbered_list "${libs[@]}" - else - write_kv_list_entry "(none set)" "" - fi -} - -### list action ### - -describe_list() { - echo "List installed gnat compilers and libs" -} - -do_list() { - compilers=( $(find_compilers ) ) - active=$(get_current_gnat) - - write_list_start "Available gnat compilers:" - - if [[ -n ${compilers[@]} ]] ; then - local i - for (( i = 0 ; i < ${#compilers[@]} ; i = i + 1 )) ; do - linkversion=${compilers[${i}]} - - [[ $linkversion == $active ]] && \ - compilers[${i}]="${compilers[${i}]} $(highlight '*' )" - done - write_numbered_list "${compilers[@]}" - - # now the libs - libs=( $(find_all_libs) ) - write_list_start "Installed libs:" - for (( i = 0 ; i < ${#libs[@]} ; i = i + 1 )) ; do - [ -f ${SPECSDIR}/${libs[$i]}/${active} ] && \ - libs[${i}]="${libs[${i}]} $(highlight '*' )" - done - write_numbered_list "${libs[@]}" - else - write_kv_list_entry "(none found)" "" - fi -} - - -### set action ### - -describe_set() { - echo "Set active gnat compiler" -} - -# The set action. Parameters: -# $1 - name of profile to set, obligatory, passed by eselect -# $2 - optional, name of env file to generate. Used from gnat.eclass. -do_set() { - if [[ -z ${1} ]] ; then - # no parameter - die -q "You didn't tell me which gnat to use" - fi - - local toset=$(get_name_from_list $1) - if [[ ${toset} == "(not-found)" ]] ; then - die -q "I don't recognise the selection" - fi - - # the action! - # in this implementation simply create an appropriate env file - local active=$(get_current_gnat) - if [[ -z ${2} ]] ; then - local envfile="${ENVDIR}/${MARKER}${toset}" - - # now we need to remove an old env file, which is guaranteed to - # be unique by get_current_gnat above - if [[ -n ${active} ]] ; then - unset_env ${active} - fi - # just for a good measure remove the one we are going to write - unset_env ${toset} - else - local envfile="$2" - fi - - generate_envFile ${toset} ${envfile} - - # force update environment - # should be replaced with "do_action env update" when #172472 gets resolved - env-update &> /dev/null -} - - - -### update action ### -# -# This action regenerates the /etc/env.d file for the current profile. Basically -# the same as set, only it does not take any parameters. It should be called from ebuilds -# installing Ada libs - -describe_update() { - echo "Update active gnat profile picking up new libs." -} - -do_update() { - local toset=$(get_current_gnat) - local envfile="${ENVDIR}/${MARKER}${toset}" - generate_envFile ${toset} ${envfile} - env-update &> /dev/null -} - -### unset action ### - -describe_unset() { - echo "Remove settings for currently active gnat" -} - -do_unset() { - local active=$(get_current_gnat) - # check whether we have any profile set before removing anything.. - if [[ -n ${active} ]] ; then - unset_env ${active} - env-update &> /dev/null - fi -} diff --git a/app-admin/eselect-gnat/files/gnat.eselect-1.1-r1 b/app-admin/eselect-gnat/files/gnat.eselect-1.1-r1 deleted file mode 100644 index 2ecaf5f9c799..000000000000 --- a/app-admin/eselect-gnat/files/gnat.eselect-1.1-r1 +++ /dev/null @@ -1,207 +0,0 @@ -# Copyright 1999-2005 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Id: gnat.eselect-1.1-r1,v 1.1 2007/12/11 23:46:46 george Exp $ - -DESCRIPTION="Manage the talled gnat compilers" -MAINTAINER="ada@gentoo.org" -SVN_DATE='$Date: 2007/12/11 23:46:46 $' -VERSION=$(svn_date_to_version "${SVN_DATE}" ) - -# "inheriting" common stuff -# this crude sourcing should be replaced by a call to function in -# libs/package-manager.bash eventually -. /usr/share/gnat/lib/gnat-common.bash - - -### Phylosophy -# Each gnat installs a "specs" file named ${ARCH}-${PN}-${SLOT} under ${SPECSDIR} -# Each lib creates a dir with its name under ${SPECSDIR} and populates it with -# similar specs files (same name scheme) -# Recognizing gnat specs from lib specs is then eazy - test entry for being a -# dir, then just check what gnat profiles are installed for each lib.. -# doset then creates env file that combines settings for gnat and for the -# corresponding profile of each installed lib.. - - -### Helpers - -# return *the* name of the active profile, checking that we do not have multiple -# env files. -# There can be only one! -get_current_gnat() { - local profiles=( $(get_env_list) ) - - if [ ${profiles[@]} == "${MARKER}*" ]; then exit; fi - - if (( 1 == ${#profiles[@]} )); then - local active=${profiles[0]#${MARKER}} - else - die -q "${ENVDIR} contains multiple gnat profiles, please cleanup!" - fi - - if [ -f ${SPECSDIR}/${active} ]; then - echo ${active} - else - die -q "the active env.d profile does not correspond to any installed gnat!" - fi -} - -# check if the passed arg represents the installed gnat and return it or -# not_found -# takes args: -# $1 - list ID to check -get_name_from_list() { - compiler=$1 - - compilers=( $(find_compilers) ) - for (( i = 0 ; i < ${#compilers[@]} ; i = i + 1 )) ; do - if [[ ${compilers[$i]} == ${compiler} ]] ; then - echo ${compiler} - return - fi - done - - echo "(not-found)" -} - - -# removes env files (for compiler and libs) -# params: -# $1: the name of profile for which to remove env file -unset_env() { - rm -f ${ENVDIR}/${MARKER}$1 &> /dev/null -} - - -### show action ### - -describe_show() { - echo "Show the active gnat compiler/profile and installed libs" -} - -do_show() { - write_list_start "Current gnat version:" - active=$(get_current_gnat) - if [ ! -z ${active} ] ; then # not sure why [ -n ] does not do the same - write_kv_list_entry "$active" "" - libs=( $(find_libs4profile ${active}) ) - write_list_start "Active libs:" - write_numbered_list "${libs[@]}" - else - write_kv_list_entry "(none set)" "" - fi -} - -### list action ### - -describe_list() { - echo "List installed gnat compilers and libs" -} - -do_list() { - compilers=( $(find_compilers ) ) - active=$(get_current_gnat) - - write_list_start "Available gnat compilers:" - - if [[ -n ${compilers[@]} ]] ; then - local i - for (( i = 0 ; i < ${#compilers[@]} ; i = i + 1 )) ; do - linkversion=${compilers[${i}]} - - [[ $linkversion == $active ]] && \ - compilers[${i}]="${compilers[${i}]} $(highlight '*' )" - done - write_numbered_list "${compilers[@]}" - - # now the libs - libs=( $(find_all_libs) ) - write_list_start "Installed libs:" - for (( i = 0 ; i < ${#libs[@]} ; i = i + 1 )) ; do - [ -f ${SPECSDIR}/${libs[$i]}/${active} ] && \ - libs[${i}]="${libs[${i}]} $(highlight '*' )" - done - write_numbered_list "${libs[@]}" - else - write_kv_list_entry "(none found)" "" - fi -} - - -### set action ### - -describe_set() { - echo "Set active gnat compiler" -} - -# The set action. Parameters: -# $1 - name of profile to set, obligatory, passed by eselect -# $2 - optional, name of env file to generate. Used from gnat.eclass. -do_set() { - if [[ -z ${1} ]] ; then - # no parameter - die -q "You didn't tell me which gnat to use" - fi - - local toset=$(get_name_from_list $1) - if [[ ${toset} == "(not-found)" ]] ; then - die -q "I don't recognise the selection" - fi - - # the action! - # in this implementation simply create an appropriate env file - local active=$(get_current_gnat) - if [[ -z ${2} ]] ; then - local envfile="${ENVDIR}/${MARKER}${toset}" - - # now we need to remove an old env file, which is guaranteed to - # be unique by get_current_gnat above - if [[ -n ${active} ]] ; then - unset_env ${active} - fi - # just for a good measure remove the one we are going to write - unset_env ${toset} - else - local envfile="$2" - fi - - generate_envFile ${toset} ${envfile} - - # force update environment - # should be replaced with "do_action env update" when #172472 gets resolved - env-update &> /dev/null -} - - - -### update action ### -# -# This action regenerates the /etc/env.d file for the current profile. Basically -# the same as set, only it does not take any parameters. It should be called from ebuilds -# installing Ada libs - -describe_update() { - echo "Update active gnat profile picking up new libs." -} - -do_update() { - local toset=$(get_current_gnat) - local envfile="${ENVDIR}/${MARKER}${toset}" - generate_envFile ${toset} ${envfile} - do_action env update &> /dev/null -} - -### unset action ### - -describe_unset() { - echo "Remove settings for currently active gnat" -} - -do_unset() { - local active=$(get_current_gnat) - # check whether we have any profile set before removing anything.. - if [[ -n ${active} ]] ; then - unset_env ${active} - do_action env update &> /dev/null - fi -} |