summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Shapovalov <george@gentoo.org>2010-01-22 12:50:15 +0000
committerGeorge Shapovalov <george@gentoo.org>2010-01-22 12:50:15 +0000
commit47cfb0e61967820720b1d016412735d6901149e1 (patch)
treef3664201c593b42a08e7ecda9b462e2a35c5d240 /app-admin
parentBump to latest rc. (diff)
downloadhistorical-47cfb0e61967820720b1d016412735d6901149e1.tar.gz
historical-47cfb0e61967820720b1d016412735d6901149e1.tar.bz2
historical-47cfb0e61967820720b1d016412735d6901149e1.zip
new version, supporting brief output mode (#292105)
Package-Manager: portage-2.1.7.16/cvs/Linux x86_64
Diffstat (limited to 'app-admin')
-rw-r--r--app-admin/eselect-gnat/ChangeLog10
-rw-r--r--app-admin/eselect-gnat/Manifest4
-rw-r--r--app-admin/eselect-gnat/eselect-gnat-1.5.ebuild35
-rw-r--r--app-admin/eselect-gnat/files/gnat.eselect-1.5226
4 files changed, 272 insertions, 3 deletions
diff --git a/app-admin/eselect-gnat/ChangeLog b/app-admin/eselect-gnat/ChangeLog
index c3052a707e9d..58fa553b2a61 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-2008 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-admin/eselect-gnat/ChangeLog,v 1.28 2008/05/17 06:26:51 george Exp $
+# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/app-admin/eselect-gnat/ChangeLog,v 1.29 2010/01/22 12:50:14 george Exp $
+
+*eselect-gnat-1.5 (22 Jan 2010)
+
+ 22 Jan 2010; George Shapovalov <george@gentoo.org>
+ +files/gnat.eselect-1.5, +eselect-gnat-1.5.ebuild:
+ new version, supporting brief output mode (#292105)
16 May 2008; George Shapovalov <george@gentoo.org>
-files/gnat.eselect-1.2, -files/gnat-common-1.2.bash,
diff --git a/app-admin/eselect-gnat/Manifest b/app-admin/eselect-gnat/Manifest
index 57be8379ecdc..85f61e220d3a 100644
--- a/app-admin/eselect-gnat/Manifest
+++ b/app-admin/eselect-gnat/Manifest
@@ -2,8 +2,10 @@ AUX gnat-common-1.3-r1.bash 6852 RMD160 e4dfca2ec70c724ff5b762408926c6c404c379c8
AUX gnat-common-1.4-r1.bash 6808 RMD160 9f4b9735c460d2a9528cf1725b4f18dab03d59ee SHA1 3caa03b14c11c7a2baadda8b62bcc5766b8e011f SHA256 3085ce636b4070015a747b2c82b24e4342a57a320cf9d2ca4c4eda93eb0740d9
AUX gnat.eselect-1.3 5309 RMD160 86e9172a9fff2d05961ec858383ec410f2f7f67a SHA1 4e1f8451c96d46e2f1a4017e6faf476cfb1e7dae SHA256 7474707a58cfe8e9714fd5e5982cb7fac8356927452487331d2051c3c0ff673e
AUX gnat.eselect-1.4 6032 RMD160 80c307c750de0e6e7f0bef0dcd1c460cf52dbda0 SHA1 577efc1edd60fd9b3a15121d3a69e16b694be730 SHA256 51529ecca25200b3cfaa4bc2a240cdc5df313c9cf8a4f238abf3482492521010
+AUX gnat.eselect-1.5 5962 RMD160 b37396fa75fe6880e0f9df3719cfc5d2221adb2e SHA1 703bf8fe33617f72f2d4d79d706b5637cd5595ee SHA256 f09df03d180b96bb777abed4b9d8d50e23c8571a0ed9a8e71ccdbd7066bba133
EBUILD eselect-gnat-1.3-r1.ebuild 792 RMD160 8eb2909062d0205811aa5b3cf17b223f6bdcc6db SHA1 10d83f585e3bca4a5b200b18ec1cee716836f8fa SHA256 5a05472eaa5ec150cf90501289b64e761d8f85bc4ace20fd2604dea5a7931a57
EBUILD eselect-gnat-1.4-r1.ebuild 893 RMD160 4bec5d576c08028799cf349812db7354439f11aa SHA1 c121719c4eb228cc8a59beacebce792f40e4413a SHA256 705f4ef6161abae31d810da97ded5ef9b4807895d24ace7877ea685f7fb38593
EBUILD eselect-gnat-1.4.ebuild 890 RMD160 6c21fcc83145f0bee8be89d2f0c1bb03c0c46896 SHA1 6fed4b4a5429ac7da1688d995c3a0ad40f71e5f7 SHA256 50cfe41ae51b4c863c7299681be597a9c70d9fd7aa477db1b7871423b9bdddb9
-MISC ChangeLog 5590 RMD160 ddfeeda3ed3fd10e8af23b50a8e4b06c93b2912c SHA1 6f7193f03eab96110b0154db3998ba47703b9892 SHA256 321141a677eeb29534de4986d2a8a9aeec0293a8ad4958b07321599e0bf700ef
+EBUILD eselect-gnat-1.5.ebuild 898 RMD160 1cd2d5efd01811db6c15eb8a7c00f40a64c82b0a SHA1 506d3e399d8f4059900ee67298812bf22c2630f6 SHA256 83c0abfed43e493aae96c8ab41532c5b04ea040067bf06d229222854dd59647a
+MISC ChangeLog 5784 RMD160 6ab3c3030848e852ad2e86ed845b6a0b47a577f7 SHA1 8e209d5f253490d7fcf75bec13d42b438b0f8a77 SHA256 fc77cf95a808f812453d22300566a551a833e7eadcdd4317e417b8c3b4420fa9
MISC metadata.xml 244 RMD160 784e7fb6660b05dbdd027b1e23975e26e72b7a39 SHA1 e2df521788bf35a7cf98d8b44adca1a1b03df544 SHA256 c32a1e42a5f85acb0b69af3e2644f98213d48492817c90a82c833927d2881419
diff --git a/app-admin/eselect-gnat/eselect-gnat-1.5.ebuild b/app-admin/eselect-gnat/eselect-gnat-1.5.ebuild
new file mode 100644
index 000000000000..b33ab9f09bf5
--- /dev/null
+++ b/app-admin/eselect-gnat/eselect-gnat-1.5.ebuild
@@ -0,0 +1,35 @@
+# Copyright 1999-2010 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.5.ebuild,v 1.1 2010/01/22 12:50:14 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-1.2.5"
+
+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-${PV} gnat.eselect
+ dodir ${LIBDIR}
+ insinto ${LIBDIR}
+ # !ATTN!
+ # Make sure to adjust version of installed file to a proper one if there is
+ # a change!
+ newins "${FILESDIR}"/gnat-common-1.4-r1.bash gnat-common.bash
+}
diff --git a/app-admin/eselect-gnat/files/gnat.eselect-1.5 b/app-admin/eselect-gnat/files/gnat.eselect-1.5
new file mode 100644
index 000000000000..48012a042c33
--- /dev/null
+++ b/app-admin/eselect-gnat/files/gnat.eselect-1.5
@@ -0,0 +1,226 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id: gnat.eselect-1.5,v 1.1 2010/01/22 12:50:15 george Exp $
+
+DESCRIPTION="Manage the installed gnat compilers"
+MAINTAINER="ada@gentoo.org"
+SVN_DATE='$Date: 2010/01/22 12:50:15 $'
+VERSION=$(svn_date_to_version "${SVN_DATE}" )
+
+# "inheriting" common stuff
+# this crude sourcing has to stay the way it is, as common code
+# cannot be part of some eclass (bug #192505)
+. /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
+
+ echo ${active}
+# disabling this check, as we want to use get_current_gnat with empty profile
+# as an indication that last gnat in SLOT was removed
+# if [ -f ${SPECSDIR}/${active} ]; then
+# echo ${active}
+# else
+# die -q "the active env.d profile does not correspond to any installed gnat!"
+# fi
+}
+
+# validity check that was removed from get_current_gnat, in case we need it
+# somewhere..
+# Arguments:
+# $1 - name of the gnat profiel to check
+profile_is_valid() {
+ if [[ -n $1 ]] ; then
+ [[ -f ${SPECSDIR}/$1 ]] || return 1
+ 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_all_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() {
+ active=$(get_current_gnat)
+ if $(profile_is_valid ${active}); then
+ write_list_start "Current gnat version:"
+ if [[ -n ${active} ]] ; then
+ 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
+ else
+ write_error_msg "The active profile in ${ENVDIR} is not valid! Please set a valid profile!"
+ fi
+}
+
+### list action ###
+
+describe_list() {
+ echo "List installed gnat compilers and libs"
+}
+
+do_list() {
+ compilers=( $(find_all_compilers ) )
+ active=$(get_current_gnat)
+
+ write_list_start "Available gnat compilers:"
+
+ local i
+ for (( i = 0 ; i < ${#compilers[@]} ; i = i + 1 )) ; do
+ linkversion=${compilers[${i}]}
+
+ [[ $linkversion == $active ]] && \
+ compilers[${i}]=$(highlight_marker "${compilers[${i}]}")
+ done
+ write_numbered_list -m "(none)" "${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}]=$(highlight_marker "${libs[${i}]}")
+ done
+ write_numbered_list -m "(no libs)" "${libs[@]}"
+}
+
+
+### 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 or in the pkg_postrm in gnatbuild.eclass, to clean up the
+# profile if last gnat in SLOT was removed.
+
+describe_update() {
+ echo "Update active gnat profile picking up new libs."
+}
+
+do_update() {
+ local toset=$(get_current_gnat)
+ local envfile="${ENVDIR}/${MARKER}${toset}"
+ # now check whether to update or unset the profile
+ if $(profile_is_valid ${toset}); then
+ generate_envFile ${toset} ${envfile}
+ else
+ unset_env ${toset}
+ fi
+ 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
+}