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

Contents of /eclass/sgml-catalog.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.12 - (hide annotations) (download)
Fri Jul 15 13:50:19 2005 UTC (9 years 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 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.12 # $Header: /var/cvsroot/gentoo-x86/eclass/sgml-catalog.eclass,v 1.11 2005/07/11 15:08:06 swegener 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.12 sgml-catalog_cat_include() {
12     [ -z "${WORKDIR}" ] && return
13    
14     local catalogdir="${WORKDIR}/catalogs"
15     local catalogfile="${catalogdir}/data"
16 satai 1.1
17 swegener 1.11 debug-print function $FUNCNAME $*
18 leonardop 1.12
19     [ ! -d "$catalogdir" ] && mkdir -p $catalogdir
20     echo "${1}:${2}" >> $catalogfile
21 satai 1.1 }
22    
23     sgml-catalog_cat_doinstall() {
24 swegener 1.11 debug-print function $FUNCNAME $*
25     /usr/bin/install-catalog --add $1 $2 &>/dev/null
26 satai 1.1 }
27    
28     sgml-catalog_cat_doremove() {
29 swegener 1.11 debug-print function $FUNCNAME $*
30     /usr/bin/install-catalog --remove $1 $2 &>/dev/null
31 satai 1.1 }
32    
33     sgml-catalog_pkg_postinst() {
34 leonardop 1.12 local catalogdir="${WORKDIR}/catalogs"
35     local catalogfile="${catalogdir}/data"
36    
37 swegener 1.11 debug-print function $FUNCNAME $*
38 leonardop 1.12
39     local toinstall
40     cat ${catalogfile} | while read toinstall
41 swegener 1.11 do
42 leonardop 1.12 arg1=`echo ${toinstall} | cut -f1 -d\:`
43     arg2=`echo ${toinstall} | cut -f2 -d\:`
44 swegener 1.11 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 satai 1.3 }
54    
55     sgml-catalog_pkg_prerm() {
56 swegener 1.11 sgml-catalog_cleanup
57 satai 1.1 }
58    
59 satai 1.2 sgml-catalog_pkg_postrm() {
60 leonardop 1.12 local catalogdir="${WORKDIR}/catalogs"
61     local catalogfile="${catalogdir}/data"
62    
63 swegener 1.11 debug-print function $FUNCNAME $*
64 leonardop 1.12
65     local toinstall
66     cat ${catalogfile} | while read toinstall
67 swegener 1.11 do
68 leonardop 1.12 arg1=`echo ${toinstall} | cut -f1 -d\:`
69     arg2=`echo ${toinstall} | cut -f2 -d\:`
70 swegener 1.11 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 satai 1.1 }
80    
81 satai 1.3 sgml-catalog_cleanup() {
82 swegener 1.11 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 satai 1.3 }
89    
90 satai 1.1 sgml-catalog_src_compile() {
91 swegener 1.11 return
92 satai 1.1 }
93    
94 satai 1.3 EXPORT_FUNCTIONS pkg_postrm pkg_postinst src_compile pkg_prerm

  ViewVC Help
Powered by ViewVC 1.1.20