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

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

  ViewVC Help
Powered by ViewVC 1.1.20