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

Contents of /eclass/sgml-catalog.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.12 - (show annotations) (download)
Fri Jul 15 13:50:19 2005 UTC (9 years, 2 months ago) by leonardop
Branch: MAIN
Changes since 1.11: +25 -16 lines
* sgml-catalog_cat_include(), sgml-catalog_pkg_postinst(),
  sgml-catalog_pkg_postrm():
  Implemented a different logic to keep track of the catalogs to
  install/remove, since the previous one caused problems if
  sgml-catalog_cat_include() was called from pkg_setup(). See bug #98680.

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.11 2005/07/11 15:08:06 swegener 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 sgml-catalog_cat_include() {
12 [ -z "${WORKDIR}" ] && return
13
14 local catalogdir="${WORKDIR}/catalogs"
15 local catalogfile="${catalogdir}/data"
16
17 debug-print function $FUNCNAME $*
18
19 [ ! -d "$catalogdir" ] && mkdir -p $catalogdir
20 echo "${1}:${2}" >> $catalogfile
21 }
22
23 sgml-catalog_cat_doinstall() {
24 debug-print function $FUNCNAME $*
25 /usr/bin/install-catalog --add $1 $2 &>/dev/null
26 }
27
28 sgml-catalog_cat_doremove() {
29 debug-print function $FUNCNAME $*
30 /usr/bin/install-catalog --remove $1 $2 &>/dev/null
31 }
32
33 sgml-catalog_pkg_postinst() {
34 local catalogdir="${WORKDIR}/catalogs"
35 local catalogfile="${catalogdir}/data"
36
37 debug-print function $FUNCNAME $*
38
39 local toinstall
40 cat ${catalogfile} | while read toinstall
41 do
42 arg1=`echo ${toinstall} | cut -f1 -d\:`
43 arg2=`echo ${toinstall} | cut -f2 -d\:`
44 if [ ! -e ${arg2} ]
45 then
46 ewarn "${arg2} doesn't appear to exist, although it ought to!"
47 continue
48 fi
49 einfo "Now adding ${arg2} to ${arg1} and /etc/sgml/catalog"
50 sgml-catalog_cat_doinstall ${arg1} ${arg2}
51 done
52 sgml-catalog_cleanup
53 }
54
55 sgml-catalog_pkg_prerm() {
56 sgml-catalog_cleanup
57 }
58
59 sgml-catalog_pkg_postrm() {
60 local catalogdir="${WORKDIR}/catalogs"
61 local catalogfile="${catalogdir}/data"
62
63 debug-print function $FUNCNAME $*
64
65 local toinstall
66 cat ${catalogfile} | while read toinstall
67 do
68 arg1=`echo ${toinstall} | cut -f1 -d\:`
69 arg2=`echo ${toinstall} | cut -f2 -d\:`
70 if [ -e ${arg2} ]
71 then
72 ewarn "${arg2} still exists! Not removing from ${arg1}"
73 ewarn "This is normal behavior for an upgrade ..."
74 continue
75 fi
76 einfo "Now removing $arg1 from $arg2 and /etc/sgml/catalog"
77 sgml-catalog_cat_doremove ${arg1} ${arg2}
78 done
79 }
80
81 sgml-catalog_cleanup() {
82 if [ -e /usr/bin/gensgmlenv ]
83 then
84 einfo Regenerating SGML environment variables ...
85 gensgmlenv
86 grep -v export /etc/sgml/sgml.env > /etc/env.d/93sgmltools-lite
87 fi
88 }
89
90 sgml-catalog_src_compile() {
91 return
92 }
93
94 EXPORT_FUNCTIONS pkg_postrm pkg_postinst src_compile pkg_prerm

  ViewVC Help
Powered by ViewVC 1.1.20