diff options
author | George Shapovalov <george@gentoo.org> | 2007-12-29 09:54:07 +0000 |
---|---|---|
committer | George Shapovalov <george@gentoo.org> | 2007-12-29 09:54:07 +0000 |
commit | 4ae7bc839f43ad5c334221f3063de07bae5c1ed8 (patch) | |
tree | 8afbe81d101b26fe9708cec52a67d5f174e9fcee /app-admin | |
parent | Version bump #196093 by Erik Logtenberg. (diff) | |
download | historical-4ae7bc839f43ad5c334221f3063de07bae5c1ed8.tar.gz historical-4ae7bc839f43ad5c334221f3063de07bae5c1ed8.tar.bz2 historical-4ae7bc839f43ad5c334221f3063de07bae5c1ed8.zip |
fixed problem with ADA_PROJECT_PATH when no libs are installed (203628)
Package-Manager: portage-2.1.4_rc11
Diffstat (limited to 'app-admin')
-rw-r--r-- | app-admin/eselect-gnat/ChangeLog | 8 | ||||
-rw-r--r-- | app-admin/eselect-gnat/Manifest | 19 | ||||
-rw-r--r-- | app-admin/eselect-gnat/eselect-gnat-1.3-r1.ebuild | 32 | ||||
-rw-r--r-- | app-admin/eselect-gnat/files/digest-eselect-gnat-1.3-r1 | 0 | ||||
-rw-r--r-- | app-admin/eselect-gnat/files/gnat-common-1.3-r1.bash | 223 |
5 files changed, 277 insertions, 5 deletions
diff --git a/app-admin/eselect-gnat/ChangeLog b/app-admin/eselect-gnat/ChangeLog index 52d17be69d96..2e5f78e16a2b 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-2007 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-admin/eselect-gnat/ChangeLog,v 1.19 2007/12/26 22:03:13 george Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-admin/eselect-gnat/ChangeLog,v 1.20 2007/12/29 09:54:06 george Exp $ + +*eselect-gnat-1.3-r1 (29 Dec 2007) + + 29 Dec 2007; George Shapovalov <george@gentoo.org> + +files/gnat-common-1.3-r1.bash, +eselect-gnat-1.3-r1.ebuild: + fixed problem with ADA_PROJECT_PATH when no libs are installed (203628) *eselect-gnat-1.3 (26 Dec 2007) diff --git a/app-admin/eselect-gnat/Manifest b/app-admin/eselect-gnat/Manifest index 09e92831d971..632c7137d4e0 100644 --- a/app-admin/eselect-gnat/Manifest +++ b/app-admin/eselect-gnat/Manifest @@ -2,6 +2,10 @@ AUX gnat-common-1.2.bash 7020 RMD160 b97f0b72dd97ea8a9a811115d5a21ec106fe2032 SH MD5 35f7b940ff7ae07e3da7543ca25707ef files/gnat-common-1.2.bash 7020 RMD160 b97f0b72dd97ea8a9a811115d5a21ec106fe2032 files/gnat-common-1.2.bash 7020 SHA256 26adff0b6bc5cfdaa968204e546e4cafe9630edcf27e63bbf7831299e0b75b36 files/gnat-common-1.2.bash 7020 +AUX gnat-common-1.3-r1.bash 6852 RMD160 e4dfca2ec70c724ff5b762408926c6c404c379c8 SHA1 494746b084e60e43e951fc8457310b0088b9f5a9 SHA256 4454521fc50121ab749daa442674e4240d2f0c25e00e40eca3bf947765afa9c8 +MD5 872f6315e047e169e763458029849b9b files/gnat-common-1.3-r1.bash 6852 +RMD160 e4dfca2ec70c724ff5b762408926c6c404c379c8 files/gnat-common-1.3-r1.bash 6852 +SHA256 4454521fc50121ab749daa442674e4240d2f0c25e00e40eca3bf947765afa9c8 files/gnat-common-1.3-r1.bash 6852 AUX gnat-common-1.3.bash 6638 RMD160 7edcdc54f7279bbe1d518818d79716eaa5e31837 SHA1 532227fdd69a4c7368d2902bcba96e261ff24289 SHA256 01cf7b740921569d2149e8b95e7602a718524e8e38dcd866de42e15ef691ec0b MD5 333cfe82ab6a85aac98bd1076d7bcc5f files/gnat-common-1.3.bash 6638 RMD160 7edcdc54f7279bbe1d518818d79716eaa5e31837 files/gnat-common-1.3.bash 6638 @@ -62,14 +66,18 @@ EBUILD eselect-gnat-1.2.ebuild 792 RMD160 69ab712fbb9766de7353e5e8469dee4292f76a MD5 d157fd098d3b2773a257021bddd6ec67 eselect-gnat-1.2.ebuild 792 RMD160 69ab712fbb9766de7353e5e8469dee4292f76aca eselect-gnat-1.2.ebuild 792 SHA256 d0018f3b317c87389086f36d50fcc7c8ae3079191379a75801a42dde8a42de75 eselect-gnat-1.2.ebuild 792 +EBUILD eselect-gnat-1.3-r1.ebuild 793 RMD160 a8740f3e9261ffcade37a00e268c08775f1122b7 SHA1 9a0e5564728d670f98b64a3164eaa53a44920c20 SHA256 3dc3913a5a7e4f1f6bdfdb30c89dbfc9ff976b4c748a9a9baea3aa5b2dab5bc0 +MD5 4f106a53720f1ac7cd125b0e23e9a7c8 eselect-gnat-1.3-r1.ebuild 793 +RMD160 a8740f3e9261ffcade37a00e268c08775f1122b7 eselect-gnat-1.3-r1.ebuild 793 +SHA256 3dc3913a5a7e4f1f6bdfdb30c89dbfc9ff976b4c748a9a9baea3aa5b2dab5bc0 eselect-gnat-1.3-r1.ebuild 793 EBUILD eselect-gnat-1.3.ebuild 791 RMD160 97dc5f0b96195f433ae32c7ff6ffcb25830909c1 SHA1 a2e3fd854ed59ab07370a3f6b7858ad91d67ef5f SHA256 81650e561be89188fbd4ea932d0b95b630f8499cdbddbb052d9c769e22992fc0 MD5 ca3d72d2e6fa9299f2ea7dcb80bf7a20 eselect-gnat-1.3.ebuild 791 RMD160 97dc5f0b96195f433ae32c7ff6ffcb25830909c1 eselect-gnat-1.3.ebuild 791 SHA256 81650e561be89188fbd4ea932d0b95b630f8499cdbddbb052d9c769e22992fc0 eselect-gnat-1.3.ebuild 791 -MISC ChangeLog 3973 RMD160 f26d62daed037477ce423a0dba70e7a340ab0b8f SHA1 2d0e72c7cbaa266101063389533a534e74f30595 SHA256 b50a7be05e83e769bfec293ec7d2a9bfdbdcd000207d3034dc544d4ded8a00dd -MD5 579fc9b5cba5334f03970cdcca24390e ChangeLog 3973 -RMD160 f26d62daed037477ce423a0dba70e7a340ab0b8f ChangeLog 3973 -SHA256 b50a7be05e83e769bfec293ec7d2a9bfdbdcd000207d3034dc544d4ded8a00dd ChangeLog 3973 +MISC ChangeLog 4200 RMD160 3fed840fcd08769ac7eaed81ed1cd9caefcdb82c SHA1 88800bc03b00cad33a8ad8f5a0e5db6ede54adf7 SHA256 0e0dd5f797653ddc2fcf39cdefe5710db0db159bec79ed389d3a910a6a9e4ee3 +MD5 f767916b355df08dc811313781f855fc ChangeLog 4200 +RMD160 3fed840fcd08769ac7eaed81ed1cd9caefcdb82c ChangeLog 4200 +SHA256 0e0dd5f797653ddc2fcf39cdefe5710db0db159bec79ed389d3a910a6a9e4ee3 ChangeLog 4200 MISC metadata.xml 244 RMD160 784e7fb6660b05dbdd027b1e23975e26e72b7a39 SHA1 e2df521788bf35a7cf98d8b44adca1a1b03df544 SHA256 c32a1e42a5f85acb0b69af3e2644f98213d48492817c90a82c833927d2881419 MD5 92e9934d7cc8cadaa1ca50badb669313 metadata.xml 244 RMD160 784e7fb6660b05dbdd027b1e23975e26e72b7a39 metadata.xml 244 @@ -95,3 +103,6 @@ SHA256 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 files/di MD5 d41d8cd98f00b204e9800998ecf8427e files/digest-eselect-gnat-1.3 0 RMD160 9c1185a5c5e9fc54612808977ee8f548b2258d31 files/digest-eselect-gnat-1.3 0 SHA256 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 files/digest-eselect-gnat-1.3 0 +MD5 d41d8cd98f00b204e9800998ecf8427e files/digest-eselect-gnat-1.3-r1 0 +RMD160 9c1185a5c5e9fc54612808977ee8f548b2258d31 files/digest-eselect-gnat-1.3-r1 0 +SHA256 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 files/digest-eselect-gnat-1.3-r1 0 diff --git a/app-admin/eselect-gnat/eselect-gnat-1.3-r1.ebuild b/app-admin/eselect-gnat/eselect-gnat-1.3-r1.ebuild new file mode 100644 index 000000000000..701c3b5895d3 --- /dev/null +++ b/app-admin/eselect-gnat/eselect-gnat-1.3-r1.ebuild @@ -0,0 +1,32 @@ +# 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-r1.ebuild,v 1.1 2007/12/29 09:54:06 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-${PV} gnat.eselect + dodir ${LIBDIR} + insinto ${LIBDIR} + newins "${FILESDIR}"/gnat-common-${PVR}.bash gnat-common.bash +} diff --git a/app-admin/eselect-gnat/files/digest-eselect-gnat-1.3-r1 b/app-admin/eselect-gnat/files/digest-eselect-gnat-1.3-r1 new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/app-admin/eselect-gnat/files/digest-eselect-gnat-1.3-r1 diff --git a/app-admin/eselect-gnat/files/gnat-common-1.3-r1.bash b/app-admin/eselect-gnat/files/gnat-common-1.3-r1.bash new file mode 100644 index 000000000000..76598111cf83 --- /dev/null +++ b/app-admin/eselect-gnat/files/gnat-common-1.3-r1.bash @@ -0,0 +1,223 @@ +# 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-r1.bash,v 1.1 2007/12/29 09:54:07 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}" + # ADA_PROJECT_PATH may not be set in any of the installed packages, + # we should only create this line if cumulative var is non-empty + My_ProjectPath=$(get_lib_var_settings ADA_PROJECT_PATH ${toset} ${libs[@]}) + if [[ -n ${My_ProjectPath} ]]; then + echo "ADA_PROJECT_PATH=${My_ProjectPath}" >> "${envfile}" + fi +} + |