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

Contents of /eclass/sgml-catalog.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.14 - (show annotations) (download)
Thu Sep 8 17:37:32 2005 UTC (9 years, 3 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 # Copyright 1999-2004 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/eclass/sgml-catalog.eclass,v 1.13 2005/07/15 17:01:14 leonardop Exp $
4 #
5 # Author Matthew Turk <satai@gentoo.org>
6
7 inherit base
8
9 DEPEND=">=app-text/sgml-common-0.6.3-r2"
10
11
12 # List of catalogs to install
13 SGML_TOINSTALL=""
14
15
16 sgml-catalog_cat_include() {
17 debug-print function $FUNCNAME $*
18 SGML_TOINSTALL="${SGML_TOINSTALL} ${1}:${2}"
19 }
20
21 sgml-catalog_cat_doinstall() {
22 debug-print function $FUNCNAME $*
23 /usr/bin/install-catalog --add $1 $2 &>/dev/null
24 }
25
26 sgml-catalog_cat_doremove() {
27 debug-print function $FUNCNAME $*
28 /usr/bin/install-catalog --remove $1 $2 &>/dev/null
29 }
30
31 sgml-catalog_pkg_postinst() {
32 debug-print function $FUNCNAME $*
33
34 for entry in ${SGML_TOINSTALL}; do
35 arg1=`echo ${entry} | cut -f1 -d\:`
36 arg2=`echo ${entry} | cut -f2 -d\:`
37 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 }
47
48 sgml-catalog_pkg_prerm() {
49 sgml-catalog_cleanup
50 }
51
52 sgml-catalog_pkg_postrm() {
53 debug-print function $FUNCNAME $*
54
55 for entry in ${SGML_TOINSTALL}; do
56 arg1=`echo ${entry} | cut -f1 -d\:`
57 arg2=`echo ${entry} | cut -f2 -d\:`
58 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 }
68
69 sgml-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
76 }
77
78 sgml-catalog_src_compile() {
79 return
80 }
81
82 EXPORT_FUNCTIONS pkg_postrm pkg_postinst src_compile pkg_prerm

  ViewVC Help
Powered by ViewVC 1.1.20