summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Shapovalov <george@gentoo.org>2006-06-14 18:41:50 +0000
committerGeorge Shapovalov <george@gentoo.org>2006-06-14 18:41:50 +0000
commit9810b592f51ef33491dee675535d65ea6d8fbe1f (patch)
treeea2e6361ed8a38facd8a6fa37131f87a55f5f98e /eclass/gnat.eclass
parentFix KDM symlink attack vulnerability, bug #136201. Missing return value check... (diff)
downloadgentoo-2-9810b592f51ef33491dee675535d65ea6d8fbe1f.tar.gz
gentoo-2-9810b592f51ef33491dee675535d65ea6d8fbe1f.tar.bz2
gentoo-2-9810b592f51ef33491dee675535d65ea6d8fbe1f.zip
changed env cleaning routine to a more generic form, fixes gtkada issue (#136704)
Diffstat (limited to 'eclass/gnat.eclass')
-rw-r--r--eclass/gnat.eclass25
1 files changed, 21 insertions, 4 deletions
diff --git a/eclass/gnat.eclass b/eclass/gnat.eclass
index 53b4605f8d0d..0b6feacaa54e 100644
--- a/eclass/gnat.eclass
+++ b/eclass/gnat.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/gnat.eclass,v 1.17 2006/06/10 16:19:54 swegener Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/gnat.eclass,v 1.18 2006/06/14 18:41:50 george Exp $
#
# This eclass provides the framework for ada lib installation with the split and
# SLOTted gnat compilers (gnat-xxx, gnatbuild.eclass). Each lib gets built once
@@ -16,7 +16,7 @@
inherit flag-o-matic eutils
-EXPORT_FUNCTIONS pkg_setup src_unpack src_compile
+EXPORT_FUNCTIONS pkg_setup pkg_postinst src_unpack src_compile
DESCRIPTION="Common procedures for building Ada libs using split gnat compilers"
@@ -56,7 +56,7 @@ BuildEnv=${WORKDIR}/BuildEnv
LibEnv=${WORKDIR}/LibEnv
-# env file prepared by gnat.eselect only listsnew settings for env vars
+# env file prepared by gnat.eselect only lists new settings for env vars
# we need to change that to prepend, rather than replace action..
# Takes one argument - the file to expand. This file should contain only
# var=value like lines.. (commenst are Ok)
@@ -131,7 +131,9 @@ filter_env_var() {
local libName=${2:-${PN}}
local env_str
for entry in ${entries[@]} ; do
- if [[ ${entry:$((-${#libName}))} != ${libName} ]] ; then
+ # this simply checks if $libname is a substring of the $entry, should
+ # work fine with all the present libs
+ if [[ ${entry/${libName}/} == ${entry} ]] ; then
env_str="${env_str}:${entry}"
fi
done
@@ -193,6 +195,21 @@ gnat_pkg_setup() {
}
+gnat_pkg_postinst() {
+ einfo "Updating gnat configuration to pick up ${PN} library..."
+ eselect gnat update
+ einfo "The environment has been set up to make gnat automatically find files"
+ einfo "for the installed library. In order to immediately activate these"
+ einfo "settings please run:"
+ einfo
+ einfo "env-update"
+ einfo "source /etc/profile"
+ einfo
+ einfo "Otherwise the settings will become active next time you login"
+}
+
+
+
gnat_src_unpack() {
debug-print-function $FUNCNAME $*
unpack ${A}