/[gentoo-x86]/eclass/sgml-catalog.eclass
Gentoo

Diff of /eclass/sgml-catalog.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

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

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.1.1.1

  ViewVC Help
Powered by ViewVC 1.1.20