Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 76488 Details for
Bug 111340
There's no gnat 2005 ebuild
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
gnat.eselect
gnat.eselect (text/plain), 4.19 KB, created by
George Shapovalov (RETIRED)
on 2006-01-07 14:58:30 UTC
(
hide
)
Description:
gnat.eselect
Filename:
MIME Type:
Creator:
George Shapovalov (RETIRED)
Created:
2006-01-07 14:58:30 UTC
Size:
4.19 KB
patch
obsolete
># Copyright 1999-2005 Gentoo Foundation ># Distributed under the terms of the GNU General Public License v2 ># $Id: php.eselect,v 1.1 2005/09/04 09:47:51 stuart Exp $ > >DESCRIPTION="Manage the talled gnat compilers" >MAINTAINER="ada@gentoo.org" >SVN_DATE='$Date: $' >VERSION=$(svn_date_to_version "${SVN_DATE}" ) > >SPECSDIR="/etc/eselect/gnat" >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() { > 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} >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 111340
:
75917
|
75918
|
76484
|
76485
|
76486
|
76488
|
76493
|
76780
|
76781
|
76784
|
76785
|
77129
|
77130
|
77288
|
77374
|
85982
|
87502