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

Contents of /eclass/sgml-catalog.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.14 - (hide annotations) (download)
Thu Sep 8 17:37:32 2005 UTC (8 years, 10 months ago) by leonardop
Branch: MAIN
Changes since 1.13: +14 -17 lines
* sgml-catalog.eclass: Use a global scalar instead of a bash array. Avoid
  calling 'seq' (bug #103383).

1 vapier 1.8 # Copyright 1999-2004 Gentoo Foundation
2 satai 1.1 # Distributed under the terms of the GNU General Public License v2
3 leonardop 1.14 # $Header: /var/cvsroot/gentoo-x86/eclass/sgml-catalog.eclass,v 1.13 2005/07/15 17:01:14 leonardop Exp $
4 vapier 1.5 #
5 satai 1.1 # Author Matthew Turk <satai@gentoo.org>
6    
7     inherit base
8    
9 usata 1.7 DEPEND=">=app-text/sgml-common-0.6.3-r2"
10 satai 1.1
11 leonardop 1.14
12     # List of catalogs to install
13     SGML_TOINSTALL=""
14    
15 leonardop 1.13
16 leonardop 1.12 sgml-catalog_cat_include() {
17 swegener 1.11 debug-print function $FUNCNAME $*
18 leonardop 1.14 SGML_TOINSTALL="${SGML_TOINSTALL} ${1}:${2}"
19 satai 1.1 }
20    
21     sgml-catalog_cat_doinstall() {
22 swegener 1.11 debug-print function $FUNCNAME $*
23     /usr/bin/install-catalog --add $1 $2 &>/dev/null
24 satai 1.1 }
25    
26     sgml-catalog_cat_doremove() {
27 swegener 1.11 debug-print function $FUNCNAME $*
28     /usr/bin/install-catalog --remove $1 $2 &>/dev/null
29 satai 1.1 }
30    
31     sgml-catalog_pkg_postinst() {
32 swegener 1.11 debug-print function $FUNCNAME $*
33 leonardop 1.14
34     for entry in ${SGML_TOINSTALL}; do
35     arg1=`echo ${entry} | cut -f1 -d\:`
36     arg2=`echo ${entry} | cut -f2 -d\:`
37 swegener 1.11 if [ ! -e ${arg2} ]
38     then
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"
43     sgml-catalog_cat_doinstall ${arg1} ${arg2}
44     done
45     sgml-catalog_cleanup
46 satai 1.3 }
47    
48     sgml-catalog_pkg_prerm() {
49 swegener 1.11 sgml-catalog_cleanup
50 satai 1.1 }
51    
52 satai 1.2 sgml-catalog_pkg_postrm() {
53 swegener 1.11 debug-print function $FUNCNAME $*
54 leonardop 1.14
55     for entry in ${SGML_TOINSTALL}; do
56     arg1=`echo ${entry} | cut -f1 -d\:`
57     arg2=`echo ${entry} | cut -f2 -d\:`
58 swegener 1.11 if [ -e ${arg2} ]
59     then
60     ewarn "${arg2} still exists! Not removing from ${arg1}"
61     ewarn "This is normal behavior for an upgrade ..."
62     continue
63     fi
64     einfo "Now removing $arg1 from $arg2 and /etc/sgml/catalog"
65     sgml-catalog_cat_doremove ${arg1} ${arg2}
66     done
67 satai 1.1 }
68    
69 satai 1.3 sgml-catalog_cleanup() {
70 swegener 1.11 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
76 satai 1.3 }
77    
78 satai 1.1 sgml-catalog_src_compile() {
79 swegener 1.11 return
80 satai 1.1 }
81    
82 satai 1.3 EXPORT_FUNCTIONS pkg_postrm pkg_postinst src_compile pkg_prerm

  ViewVC Help
Powered by ViewVC 1.1.20