diff options
author | George Shapovalov <george@gentoo.org> | 2006-01-22 20:04:38 +0000 |
---|---|---|
committer | George Shapovalov <george@gentoo.org> | 2006-01-22 20:04:38 +0000 |
commit | be73b2d53cc24de9141fd842a1657ee523a9c54a (patch) | |
tree | e5ab1b677430de585a1858231442fcd6ed146af5 /app-admin/eselect-gnat | |
parent | Moved from dev (diff) | |
download | gentoo-2-be73b2d53cc24de9141fd842a1657ee523a9c54a.tar.gz gentoo-2-be73b2d53cc24de9141fd842a1657ee523a9c54a.tar.bz2 gentoo-2-be73b2d53cc24de9141fd842a1657ee523a9c54a.zip |
new version: moved gnat specs under /usr/share to avoid config_protect
(Portage version: 2.1_pre3-r1)
Diffstat (limited to 'app-admin/eselect-gnat')
-rw-r--r-- | app-admin/eselect-gnat/ChangeLog | 8 | ||||
-rw-r--r-- | app-admin/eselect-gnat/Manifest | 3 | ||||
-rw-r--r-- | app-admin/eselect-gnat/eselect-gnat-0.6.ebuild | 25 | ||||
-rw-r--r-- | app-admin/eselect-gnat/files/digest-eselect-gnat-0.6 | 0 | ||||
-rw-r--r-- | app-admin/eselect-gnat/files/gnat.eselect-0.6 | 176 |
5 files changed, 211 insertions, 1 deletions
diff --git a/app-admin/eselect-gnat/ChangeLog b/app-admin/eselect-gnat/ChangeLog index 8fada89e1d71..61e5bec0e554 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.1 2006/01/17 15:18:52 george Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-admin/eselect-gnat/ChangeLog,v 1.2 2006/01/22 20:04:38 george Exp $ + +*eselect-gnat-0.6 (22 Jan 2006) + + 22 Jan 2006; George Shapovalov <george@gentoo.org> + +files/gnat.eselect-0.6, +eselect-gnat-0.6.ebuild: + new version: moved gnat specs under /usr/share to avoid config_protect *eselect-gnat-0.5 (17 Jan 2006) diff --git a/app-admin/eselect-gnat/Manifest b/app-admin/eselect-gnat/Manifest index 05c087e2c6e2..f0f247511db0 100644 --- a/app-admin/eselect-gnat/Manifest +++ b/app-admin/eselect-gnat/Manifest @@ -1,5 +1,8 @@ MD5 4c2265bc761bc2859c8ac42668a920ee ChangeLog 433 MD5 cc6de5656c9a32406a8ac1daf4002efe eselect-gnat-0.5.ebuild 532 +MD5 da3ce7fca347ff293ea5475724c6e183 eselect-gnat-0.6.ebuild 515 MD5 d41d8cd98f00b204e9800998ecf8427e files/digest-eselect-gnat-0.5 0 +MD5 d41d8cd98f00b204e9800998ecf8427e files/digest-eselect-gnat-0.6 0 MD5 ecea91aed77d42448b0b49491f364f30 files/gnat.eselect 4311 +MD5 5fd668f6f2d99a0330fb26311a59250a files/gnat.eselect-0.6 4326 MD5 92e9934d7cc8cadaa1ca50badb669313 metadata.xml 244 diff --git a/app-admin/eselect-gnat/eselect-gnat-0.6.ebuild b/app-admin/eselect-gnat/eselect-gnat-0.6.ebuild new file mode 100644 index 000000000000..4f86d1695832 --- /dev/null +++ b/app-admin/eselect-gnat/eselect-gnat-0.6.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.6.ebuild,v 1.1 2006/01/22 20:04:38 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.6 b/app-admin/eselect-gnat/files/digest-eselect-gnat-0.6 new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/app-admin/eselect-gnat/files/digest-eselect-gnat-0.6 diff --git a/app-admin/eselect-gnat/files/gnat.eselect-0.6 b/app-admin/eselect-gnat/files/gnat.eselect-0.6 new file mode 100644 index 000000000000..cffc4e115897 --- /dev/null +++ b/app-admin/eselect-gnat/files/gnat.eselect-0.6 @@ -0,0 +1,176 @@ +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id: gnat.eselect-0.6,v 1.1 2006/01/22 20:04:38 george Exp $ + +DESCRIPTION="Manage the talled gnat compilers" +MAINTAINER="ada@gentoo.org" +SVN_DATE='$Date: 2006/01/22 20:04:38 $' +VERSION=$(svn_date_to_version "${SVN_DATE}" ) + +SPECSDIR="/usr/share/gnat/eselect" +ENVDIR="/etc/env.d" +MARKER="55gnat-" + +### 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 + echo $(basename ${fn}); + 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 $2 $1|cut -d= -f2) + echo ${var} +} + + +# removes env file +# 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" +} + +do_show() { + write_list_start "Current gnat version:" + active=$(get_current_gnat) + [ -z $active ] && active="(none set)" + write_kv_list_entry "$active" "" +} + +### list action ### + +describe_list() { + echo "List installed gnat compilers" +} + +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" +} + +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) + 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 + unset_env ${active} + # just for a good measure remove the one we are going to write + unset_env ${toset} + + local binpath="$(get_var_from_spec ${SPECSDIR}/${toset} binpath)" + local libexecpath="$(get_var_from_spec ${SPECSDIR}/${toset} libexecpath)" + echo "PATH=${binpath}:${libexecpath}" >> "${envfile}" + echo "MANPATH=$(get_var_from_spec ${SPECSDIR}/${toset} manpath)" >> "${envfile}" + echo "INFOPATH=$(get_var_from_spec ${SPECSDIR}/${toset} infopath)" >> "${envfile}" + echo "ADA_INCLUDE_PATH=$(get_var_from_spec ${SPECSDIR}/${toset} ldpath)/adainclude" >> "${envfile}" + echo "ADA_OBJECTS_PATH=$(get_var_from_spec ${SPECSDIR}/${toset} ldpath)/adalib" >> "${envfile}" +} + + +### unset action ### + +describe_unset() { + echo "Remove settings for currently active gnat" +} + +do_unset() { + local active=$(get_current_gnat) + unset_env ${active} +} |