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

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.11

  ViewVC Help
Powered by ViewVC 1.1.20