diff options
author | George Shapovalov <george@gentoo.org> | 2006-05-02 10:18:57 +0000 |
---|---|---|
committer | George Shapovalov <george@gentoo.org> | 2006-05-02 10:18:57 +0000 |
commit | b4af96e895a776697d963068365e265250afe105 (patch) | |
tree | db38ad74f5885c14d9c488696e0ff6c833f90344 /app-admin/eselect-gnat | |
parent | masked >=app-admin/eselect-gnat-0.7 - initial testing of Ada libs support wit... (diff) | |
download | historical-b4af96e895a776697d963068365e265250afe105.tar.gz historical-b4af96e895a776697d963068365e265250afe105.tar.bz2 historical-b4af96e895a776697d963068365e265250afe105.zip |
new version of eselect module, first shot at supporting Ada libs
Package-Manager: portage-2.1_pre10-r2
Diffstat (limited to 'app-admin/eselect-gnat')
-rw-r--r-- | app-admin/eselect-gnat/ChangeLog | 8 | ||||
-rw-r--r-- | app-admin/eselect-gnat/Manifest | 47 | ||||
-rw-r--r-- | app-admin/eselect-gnat/eselect-gnat-0.7.ebuild | 25 | ||||
-rw-r--r-- | app-admin/eselect-gnat/files/digest-eselect-gnat-0.5 | 1 | ||||
-rw-r--r-- | app-admin/eselect-gnat/files/digest-eselect-gnat-0.6 | 1 | ||||
-rw-r--r-- | app-admin/eselect-gnat/files/digest-eselect-gnat-0.7 | 1 | ||||
-rw-r--r-- | app-admin/eselect-gnat/files/gnat.eselect-0.7 | 284 |
7 files changed, 351 insertions, 16 deletions
diff --git a/app-admin/eselect-gnat/ChangeLog b/app-admin/eselect-gnat/ChangeLog index 61e5bec0e554..c7a83c2a693c 100644 --- a/app-admin/eselect-gnat/ChangeLog +++ b/app-admin/eselect-gnat/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for app-admin/eselect-gnat # Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-admin/eselect-gnat/ChangeLog,v 1.2 2006/01/22 20:04:38 george Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-admin/eselect-gnat/ChangeLog,v 1.3 2006/05/02 10:18:57 george Exp $ + +*eselect-gnat-0.7 (02 May 2006) + + 02 May 2006; George Shapovalov <george@gentoo.org> + +files/gnat.eselect-0.7, +eselect-gnat-0.7.ebuild: + new version of eselect module, first shot at supporting Ada libs *eselect-gnat-0.6 (22 Jan 2006) diff --git a/app-admin/eselect-gnat/Manifest b/app-admin/eselect-gnat/Manifest index 77f07969e229..8de2b48e2106 100644 --- a/app-admin/eselect-gnat/Manifest +++ b/app-admin/eselect-gnat/Manifest @@ -1,24 +1,41 @@ -MD5 112b6c17fb19b5b0422546f77f6329a8 ChangeLog 646 -RMD160 220a20a27f616bb0b110d4fa02a9f511419e056e ChangeLog 646 -SHA256 fe0e8475cc289bf3ee35a6045ead49319bd467f1082cccfaab689255e3199ced ChangeLog 646 -MD5 cc6de5656c9a32406a8ac1daf4002efe eselect-gnat-0.5.ebuild 532 -RMD160 9829d41174edec589ceea93a32db824e1d7544c1 eselect-gnat-0.5.ebuild 532 -SHA256 e4dd83ef5dd80054712742b3a0604b35a473cceaba8ceb58ba00074cb568b0b0 eselect-gnat-0.5.ebuild 532 -MD5 860e7d60cfffda1ccf581b6278fca3bc eselect-gnat-0.6.ebuild 623 -RMD160 0a97dcf6e1f3a8a9d94fe29176236ddcd5cf056c eselect-gnat-0.6.ebuild 623 -SHA256 7822d164d49b0b8ee2e3ef6288a0940c47623301305a1acb3cb1e1dbab272b38 eselect-gnat-0.6.ebuild 623 -MD5 d41d8cd98f00b204e9800998ecf8427e files/digest-eselect-gnat-0.5 0 -RMD160 9c1185a5c5e9fc54612808977ee8f548b2258d31 files/digest-eselect-gnat-0.5 0 -SHA256 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 files/digest-eselect-gnat-0.5 0 -MD5 d41d8cd98f00b204e9800998ecf8427e files/digest-eselect-gnat-0.6 0 -RMD160 9c1185a5c5e9fc54612808977ee8f548b2258d31 files/digest-eselect-gnat-0.6 0 -SHA256 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 files/digest-eselect-gnat-0.6 0 +AUX gnat.eselect 4311 RMD160 5b4a1c9c69560f0f6782c7bf4527cb24d16ad05d SHA1 4f25347bd25794db2a284889d2ff2755bfd6e1d9 SHA256 1cdcaccabb4f5c57d32487dd9addd5dcc42c380c07052f8b469fcc296997d05b size 4311 MD5 ecea91aed77d42448b0b49491f364f30 files/gnat.eselect 4311 RMD160 5b4a1c9c69560f0f6782c7bf4527cb24d16ad05d files/gnat.eselect 4311 SHA256 1cdcaccabb4f5c57d32487dd9addd5dcc42c380c07052f8b469fcc296997d05b files/gnat.eselect 4311 +AUX gnat.eselect-0.6 4354 RMD160 b74126359dec9f1465f65fae865570de2275ed9c SHA1 17d6fbfeeeea3c8224ad03f8a596a1ea2c5a2c3c SHA256 6f837d55365ca1ea53f9978cbacd9e1befd06865633f425a10fbf450772f2230 size 4354 MD5 db251ae42afc360063d8137f13176f98 files/gnat.eselect-0.6 4354 RMD160 b74126359dec9f1465f65fae865570de2275ed9c files/gnat.eselect-0.6 4354 SHA256 6f837d55365ca1ea53f9978cbacd9e1befd06865633f425a10fbf450772f2230 files/gnat.eselect-0.6 4354 +AUX gnat.eselect-0.7 7712 RMD160 775f15dbbcdd47158c64a2cabce5634bef35c1d3 SHA1 f379bb04dad91e511738eb92ee147273b67a7241 SHA256 b18c2814e41bb0baa549a53feec26c7cc04325b9d5d6dc67ee3c74eeab6526a2 size 7712 +MD5 0b90034ae60254426141492bb9808d19 files/gnat.eselect-0.7 7712 +RMD160 775f15dbbcdd47158c64a2cabce5634bef35c1d3 files/gnat.eselect-0.7 7712 +SHA256 b18c2814e41bb0baa549a53feec26c7cc04325b9d5d6dc67ee3c74eeab6526a2 files/gnat.eselect-0.7 7712 +EBUILD eselect-gnat-0.5.ebuild 532 RMD160 9829d41174edec589ceea93a32db824e1d7544c1 SHA1 471f313406b1db0c940c9cf8cde276271ac67a3a SHA256 e4dd83ef5dd80054712742b3a0604b35a473cceaba8ceb58ba00074cb568b0b0 size 532 +MD5 cc6de5656c9a32406a8ac1daf4002efe eselect-gnat-0.5.ebuild 532 +RMD160 9829d41174edec589ceea93a32db824e1d7544c1 eselect-gnat-0.5.ebuild 532 +SHA256 e4dd83ef5dd80054712742b3a0604b35a473cceaba8ceb58ba00074cb568b0b0 eselect-gnat-0.5.ebuild 532 +EBUILD eselect-gnat-0.6.ebuild 623 RMD160 0a97dcf6e1f3a8a9d94fe29176236ddcd5cf056c SHA1 81ea2318530ab351e5b7c1721987c0e9d6194d93 SHA256 7822d164d49b0b8ee2e3ef6288a0940c47623301305a1acb3cb1e1dbab272b38 size 623 +MD5 860e7d60cfffda1ccf581b6278fca3bc eselect-gnat-0.6.ebuild 623 +RMD160 0a97dcf6e1f3a8a9d94fe29176236ddcd5cf056c eselect-gnat-0.6.ebuild 623 +SHA256 7822d164d49b0b8ee2e3ef6288a0940c47623301305a1acb3cb1e1dbab272b38 eselect-gnat-0.6.ebuild 623 +EBUILD eselect-gnat-0.7.ebuild 623 RMD160 6120ba6e8f37ec328a64658f1f61824c45e678c5 SHA1 a815e77026b2c998bcc0003eaa360b2b4c453cc9 SHA256 2b850296732515727a6969895d9a14e096a06633034fd56e3b88f68d7d6b93ee size 623 +MD5 c3af14b9775c7785b643c40150c667e5 eselect-gnat-0.7.ebuild 623 +RMD160 6120ba6e8f37ec328a64658f1f61824c45e678c5 eselect-gnat-0.7.ebuild 623 +SHA256 2b850296732515727a6969895d9a14e096a06633034fd56e3b88f68d7d6b93ee eselect-gnat-0.7.ebuild 623 +MISC ChangeLog 853 RMD160 430a4a7d795f91e7d832493fc61f7ab9617ac090 SHA1 741db67c0a6823d4bfa3f26afba5118abf25d67b SHA256 de12743354b3098509872f2f842a15703c3e77b33d2a020954151c09f8685984 size 853 +MD5 fdf90db2abbcf42c8f13917e6abb2f5c ChangeLog 853 +RMD160 430a4a7d795f91e7d832493fc61f7ab9617ac090 ChangeLog 853 +SHA256 de12743354b3098509872f2f842a15703c3e77b33d2a020954151c09f8685984 ChangeLog 853 +MISC metadata.xml 244 RMD160 784e7fb6660b05dbdd027b1e23975e26e72b7a39 SHA1 e2df521788bf35a7cf98d8b44adca1a1b03df544 SHA256 c32a1e42a5f85acb0b69af3e2644f98213d48492817c90a82c833927d2881419 size 244 MD5 92e9934d7cc8cadaa1ca50badb669313 metadata.xml 244 RMD160 784e7fb6660b05dbdd027b1e23975e26e72b7a39 metadata.xml 244 SHA256 c32a1e42a5f85acb0b69af3e2644f98213d48492817c90a82c833927d2881419 metadata.xml 244 +MD5 68b329da9893e34099c7d8ad5cb9c940 files/digest-eselect-gnat-0.5 1 +RMD160 c0da025038ed83c687ddc430da9846ecb97f3998 files/digest-eselect-gnat-0.5 1 +SHA256 01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b files/digest-eselect-gnat-0.5 1 +MD5 68b329da9893e34099c7d8ad5cb9c940 files/digest-eselect-gnat-0.6 1 +RMD160 c0da025038ed83c687ddc430da9846ecb97f3998 files/digest-eselect-gnat-0.6 1 +SHA256 01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b files/digest-eselect-gnat-0.6 1 +MD5 68b329da9893e34099c7d8ad5cb9c940 files/digest-eselect-gnat-0.7 1 +RMD160 c0da025038ed83c687ddc430da9846ecb97f3998 files/digest-eselect-gnat-0.7 1 +SHA256 01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b files/digest-eselect-gnat-0.7 1 diff --git a/app-admin/eselect-gnat/eselect-gnat-0.7.ebuild b/app-admin/eselect-gnat/eselect-gnat-0.7.ebuild new file mode 100644 index 000000000000..846bee919d24 --- /dev/null +++ b/app-admin/eselect-gnat/eselect-gnat-0.7.ebuild @@ -0,0 +1,25 @@ +# Copyright 1999-2006 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.7.ebuild,v 1.1 2006/05/02 10:18:57 george Exp $ + +inherit eutils + +DESCRIPTION="gnat module for eselect." +HOMEPAGE="http://www.gentoo.org" +SRC_URI="" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" + +IUSE="" +RDEPEND="app-admin/eselect" + +MODULEDIR="/usr/share/eselect/modules" + +src_install() { + dodir ${MODULEDIR} + insinto ${MODULEDIR} + doins ${FILESDIR}/gnat.eselect-${PV} + mv ${D}${MODULEDIR}/gnat.eselect-${PV} ${D}${MODULEDIR}/gnat.eselect +} diff --git a/app-admin/eselect-gnat/files/digest-eselect-gnat-0.5 b/app-admin/eselect-gnat/files/digest-eselect-gnat-0.5 index e69de29bb2d1..8b137891791f 100644 --- a/app-admin/eselect-gnat/files/digest-eselect-gnat-0.5 +++ b/app-admin/eselect-gnat/files/digest-eselect-gnat-0.5 @@ -0,0 +1 @@ + diff --git a/app-admin/eselect-gnat/files/digest-eselect-gnat-0.6 b/app-admin/eselect-gnat/files/digest-eselect-gnat-0.6 index e69de29bb2d1..8b137891791f 100644 --- a/app-admin/eselect-gnat/files/digest-eselect-gnat-0.6 +++ b/app-admin/eselect-gnat/files/digest-eselect-gnat-0.6 @@ -0,0 +1 @@ + diff --git a/app-admin/eselect-gnat/files/digest-eselect-gnat-0.7 b/app-admin/eselect-gnat/files/digest-eselect-gnat-0.7 new file mode 100644 index 000000000000..8b137891791f --- /dev/null +++ b/app-admin/eselect-gnat/files/digest-eselect-gnat-0.7 @@ -0,0 +1 @@ + diff --git a/app-admin/eselect-gnat/files/gnat.eselect-0.7 b/app-admin/eselect-gnat/files/gnat.eselect-0.7 new file mode 100644 index 000000000000..1172b8a8994e --- /dev/null +++ b/app-admin/eselect-gnat/files/gnat.eselect-0.7 @@ -0,0 +1,284 @@ +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id: gnat.eselect-0.7,v 1.1 2006/05/02 10:18:57 george Exp $ + +DESCRIPTION="Manage the talled gnat compilers" +MAINTAINER="ada@gentoo.org" +SVN_DATE='$Date: 2006/05/02 10:18:57 $' +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 - list of libs to check (to avoid its composition every time) +# $2 - name of gnat profile +# $3 - name of env var to process +get_lib_var_settings() { + local libList=$1 + #echo "get_lib_var_settings: ${libList[@]}" >> rep.rep + if [[ ! ${libList[0]} == "none" ]]; then + + local envString + for (( i = 0 ; i < ${#libList[@]} ; i = i + 1 )) ; do + #echo "lib $i = ${libList[$i]}" >> rep.rep + specLine=$(get_var_from_spec ${SPECSDIR}/${libList[$i]}/$2 $3) + [[ -n ${specLine} ]] && envString="${envString}:${specLine}" + 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}) ) + if (( 0 == ${#libs[@]} )); then + libs="none" + fi + + echo "PATH=${binpath}:${libexecpath}$(get_lib_var_settings ${libs} ${toset} "PATH")" > "${envfile}" + echo "MANPATH=$(get_var_from_spec ${SPECSDIR}/${toset} manpath)$(get_lib_var_settings ${libs} ${toset} "MANPATH")" >> "${envfile}" + echo "INFOPATH=$(get_var_from_spec ${SPECSDIR}/${toset} infopath)$(get_lib_var_settings ${libs} ${toset} "INFOPATH")" >> "${envfile}" + echo "ADA_INCLUDE_PATH=$(get_var_from_spec ${SPECSDIR}/${toset} ldpath)/adainclude$(get_lib_var_settings ${libs} ${toset} "ADA_INCLUDE_PATH")" >> "${envfile}" + echo "ADA_OBJECTS_PATH=$(get_var_from_spec ${SPECSDIR}/${toset} ldpath)/adalib$(get_lib_var_settings ${libs} ${toset} "ADA_OBJECTS_PATH")" >> "${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) ) + 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[@]}" + 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 +} |