summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Olexa <darkside@gentoo.org>2010-05-13 21:38:11 +0000
committerJeremy Olexa <darkside@gentoo.org>2010-05-13 21:38:11 +0000
commit5a5a49c315604c503d519e12b911e15c83692542 (patch)
tree6460544d97d416b91167fc8d7bbcbdfe726ec2dc /eclass/sgml-catalog.eclass
parentAdd Gentoo Prefix changes. Bump to EAPI3, add keywords. bug 316827 (diff)
downloadgentoo-2-5a5a49c315604c503d519e12b911e15c83692542.tar.gz
gentoo-2-5a5a49c315604c503d519e12b911e15c83692542.tar.bz2
gentoo-2-5a5a49c315604c503d519e12b911e15c83692542.zip
sgml-catalog.eclass: Add EAPI3/Gentoo Prefix support. bug 310777
Diffstat (limited to 'eclass/sgml-catalog.eclass')
-rw-r--r--eclass/sgml-catalog.eclass35
1 files changed, 20 insertions, 15 deletions
diff --git a/eclass/sgml-catalog.eclass b/eclass/sgml-catalog.eclass
index 02c4caa93df4..e59257efe120 100644
--- a/eclass/sgml-catalog.eclass
+++ b/eclass/sgml-catalog.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/sgml-catalog.eclass,v 1.14 2005/09/08 17:37:32 leonardop Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/sgml-catalog.eclass,v 1.15 2010/05/13 21:38:11 darkside Exp $
#
# Author Matthew Turk <satai@gentoo.org>
@@ -20,26 +20,29 @@ sgml-catalog_cat_include() {
sgml-catalog_cat_doinstall() {
debug-print function $FUNCNAME $*
- /usr/bin/install-catalog --add $1 $2 &>/dev/null
+ has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
+ "${EPREFIX}"/usr/bin/install-catalog --add "${EPREFIX}/$1" "${EPREFIX}/$2" &>/dev/null
}
sgml-catalog_cat_doremove() {
debug-print function $FUNCNAME $*
- /usr/bin/install-catalog --remove $1 $2 &>/dev/null
+ has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
+ "${EPREFIX}"/usr/bin/install-catalog --remove "${EPREFIX}/$1" "${EPREFIX}/$2" &>/dev/null
}
sgml-catalog_pkg_postinst() {
debug-print function $FUNCNAME $*
+ has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
for entry in ${SGML_TOINSTALL}; do
- arg1=`echo ${entry} | cut -f1 -d\:`
- arg2=`echo ${entry} | cut -f2 -d\:`
- if [ ! -e ${arg2} ]
+ arg1=${entry%%:*}
+ arg2=${entry#*:}
+ if [ ! -e "${EPREFIX}"${arg2} ]
then
- ewarn "${arg2} doesn't appear to exist, although it ought to!"
+ ewarn "${EPREFIX}${arg2} doesn't appear to exist, although it ought to!"
continue
fi
- einfo "Now adding ${arg2} to ${arg1} and /etc/sgml/catalog"
+ einfo "Now adding ${EPREFIX}${arg2} to ${EPREFIX}${arg1} and ${EPREFIX}/etc/sgml/catalog"
sgml-catalog_cat_doinstall ${arg1} ${arg2}
done
sgml-catalog_cleanup
@@ -51,27 +54,29 @@ sgml-catalog_pkg_prerm() {
sgml-catalog_pkg_postrm() {
debug-print function $FUNCNAME $*
+ has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
for entry in ${SGML_TOINSTALL}; do
- arg1=`echo ${entry} | cut -f1 -d\:`
- arg2=`echo ${entry} | cut -f2 -d\:`
- if [ -e ${arg2} ]
+ arg1=${entry%%:*}
+ arg2=${entry#*:}
+ if [ -e "${EPREFIX}"${arg2} ]
then
- ewarn "${arg2} still exists! Not removing from ${arg1}"
+ ewarn "${EPREFIX}${arg2} still exists! Not removing from ${EPREFIX}${arg1}"
ewarn "This is normal behavior for an upgrade ..."
continue
fi
- einfo "Now removing $arg1 from $arg2 and /etc/sgml/catalog"
+ einfo "Now removing ${EPREFIX}${arg1} from ${EPREFIX}${arg2} and ${EPREFIX}/etc/sgml/catalog"
sgml-catalog_cat_doremove ${arg1} ${arg2}
done
}
sgml-catalog_cleanup() {
- if [ -e /usr/bin/gensgmlenv ]
+ has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
+ if [ -e "${EPREFIX}/usr/bin/gensgmlenv" ]
then
einfo Regenerating SGML environment variables ...
gensgmlenv
- grep -v export /etc/sgml/sgml.env > /etc/env.d/93sgmltools-lite
+ grep -v export "${EPREFIX}/etc/sgml/sgml.env" > "${EPREFIX}/etc/env.d/93sgmltools-lite"
fi
}