| 1 |
vapier |
1.5 |
# Copyright 1999-2003 Gentoo Technologies, Inc.
|
| 2 |
satai |
1.1 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
foser |
1.6 |
# $Header: /home/cvsroot/gentoo-x86/eclass/sgml-catalog.eclass,v 1.5 2003/02/16 04:26:21 vapier Exp $
|
| 4 |
vapier |
1.5 |
#
|
| 5 |
satai |
1.1 |
# Author Matthew Turk <satai@gentoo.org>
|
| 6 |
|
|
|
| 7 |
|
|
inherit base
|
| 8 |
|
|
INHERITED="$INHERITED $ECLASS"
|
| 9 |
|
|
|
| 10 |
foser |
1.6 |
newdepend ">=app-text/sgml-common-0.6.3-r2"
|
| 11 |
satai |
1.1 |
ECLASS=sgml-catalog
|
| 12 |
|
|
|
| 13 |
|
|
declare -a toinstall
|
| 14 |
|
|
declare -i catcounter
|
| 15 |
|
|
let "catcounter=0"
|
| 16 |
|
|
|
| 17 |
|
|
sgml-catalog_cat_include() {
|
| 18 |
|
|
debug-print function $FUNCNAME $*
|
| 19 |
|
|
toinstall["catcounter++"]="${1}:${2}"
|
| 20 |
|
|
}
|
| 21 |
|
|
|
| 22 |
|
|
sgml-catalog_cat_doinstall() {
|
| 23 |
|
|
debug-print function $FUNCNAME $*
|
| 24 |
|
|
/usr/bin/install-catalog --add $1 $2 &>/dev/null
|
| 25 |
|
|
}
|
| 26 |
|
|
|
| 27 |
|
|
sgml-catalog_cat_doremove() {
|
| 28 |
|
|
debug-print function $FUNCNAME $*
|
| 29 |
|
|
/usr/bin/install-catalog --remove $1 $2 &>/dev/null
|
| 30 |
|
|
}
|
| 31 |
|
|
|
| 32 |
|
|
sgml-catalog_pkg_postinst() {
|
| 33 |
|
|
debug-print function $FUNCNAME $*
|
| 34 |
|
|
declare -i topindex
|
| 35 |
|
|
topindex="catcounter-1"
|
| 36 |
|
|
for i in `seq 0 ${topindex}`
|
| 37 |
|
|
do
|
| 38 |
|
|
arg1=`echo ${toinstall[$i]} | cut -f1 -d\:`
|
| 39 |
|
|
arg2=`echo ${toinstall[$i]} | cut -f2 -d\:`
|
| 40 |
satai |
1.2 |
if [ ! -e $arg2 ]
|
| 41 |
|
|
then
|
| 42 |
|
|
ewarn "${arg2} doesn't appear to exist, although it ought to!"
|
| 43 |
satai |
1.3 |
continue
|
| 44 |
satai |
1.2 |
fi
|
| 45 |
satai |
1.4 |
einfo "Now adding $arg2 to $arg1 and /etc/sgml/catalog"
|
| 46 |
satai |
1.1 |
sgml-catalog_cat_doinstall $arg1 $arg2
|
| 47 |
|
|
done
|
| 48 |
satai |
1.3 |
sgml-catalog_cleanup
|
| 49 |
|
|
}
|
| 50 |
|
|
|
| 51 |
|
|
sgml-catalog_pkg_prerm() {
|
| 52 |
|
|
sgml-catalog_cleanup
|
| 53 |
satai |
1.1 |
}
|
| 54 |
|
|
|
| 55 |
satai |
1.2 |
sgml-catalog_pkg_postrm() {
|
| 56 |
satai |
1.1 |
debug-print function $FUNCNAME $*
|
| 57 |
|
|
declare -i topindex
|
| 58 |
|
|
topindex="catcounter-1"
|
| 59 |
|
|
for i in `seq 0 ${topindex}`
|
| 60 |
|
|
do
|
| 61 |
|
|
arg1=`echo ${toinstall[$i]} | cut -f1 -d\:`
|
| 62 |
|
|
arg2=`echo ${toinstall[$i]} | cut -f2 -d\:`
|
| 63 |
satai |
1.2 |
if [ -e $arg2 ]
|
| 64 |
|
|
then
|
| 65 |
|
|
ewarn "${arg2} still exists! Not removing from ${arg1}"
|
| 66 |
|
|
ewarn "This is normal behavior for an upgrade..."
|
| 67 |
satai |
1.3 |
continue
|
| 68 |
satai |
1.2 |
fi
|
| 69 |
satai |
1.1 |
einfo "Now removing $arg1 from $arg2 and /etc/sgml/catalog"
|
| 70 |
|
|
sgml-catalog_cat_doremove $arg1 $arg2
|
| 71 |
|
|
done
|
| 72 |
|
|
}
|
| 73 |
|
|
|
| 74 |
satai |
1.3 |
sgml-catalog_cleanup() {
|
| 75 |
|
|
if [ -e /usr/bin/gensgmlenv ]
|
| 76 |
|
|
then
|
| 77 |
|
|
einfo Regenerating SGML environment variables...
|
| 78 |
|
|
gensgmlenv
|
| 79 |
|
|
grep -v export /etc/sgml/sgml.env > /etc/env.d/93sgmltools-lite
|
| 80 |
|
|
fi
|
| 81 |
|
|
}
|
| 82 |
|
|
|
| 83 |
satai |
1.1 |
sgml-catalog_src_compile() {
|
| 84 |
satai |
1.2 |
return
|
| 85 |
satai |
1.1 |
}
|
| 86 |
|
|
|
| 87 |
satai |
1.3 |
EXPORT_FUNCTIONS pkg_postrm pkg_postinst src_compile pkg_prerm
|