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

Contents of /eclass/sgml-catalog.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.18 - (hide annotations) (download)
Fri Mar 23 06:16:15 2012 UTC (2 years ago) by floppym
Branch: MAIN
Changes since 1.17: +3 -9 lines
PMS says that postrm runs before postinst, so remove workaround in sgml-catalog_pkg_postrm. Fix order of arguments in einfo message.

1 floppym 1.18 # Copyright 1999-2012 Gentoo Foundation
2 satai 1.1 # Distributed under the terms of the GNU General Public License v2
3 floppym 1.18 # $Header: /var/cvsroot/gentoo-x86/eclass/sgml-catalog.eclass,v 1.17 2011/12/27 17:55:12 fauli 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 darkside 1.15 has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
24 abcd 1.16 "${EPREFIX}"/usr/bin/install-catalog --add "${EPREFIX}$1" "${EPREFIX}$2" &>/dev/null
25 satai 1.1 }
26    
27     sgml-catalog_cat_doremove() {
28 swegener 1.11 debug-print function $FUNCNAME $*
29 darkside 1.15 has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
30 abcd 1.16 "${EPREFIX}"/usr/bin/install-catalog --remove "${EPREFIX}$1" "${EPREFIX}$2" &>/dev/null
31 satai 1.1 }
32    
33     sgml-catalog_pkg_postinst() {
34 swegener 1.11 debug-print function $FUNCNAME $*
35 darkside 1.15 has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
36 leonardop 1.14
37     for entry in ${SGML_TOINSTALL}; do
38 darkside 1.15 arg1=${entry%%:*}
39     arg2=${entry#*:}
40     if [ ! -e "${EPREFIX}"${arg2} ]
41 swegener 1.11 then
42 darkside 1.15 ewarn "${EPREFIX}${arg2} doesn't appear to exist, although it ought to!"
43 swegener 1.11 continue
44     fi
45 darkside 1.15 einfo "Now adding ${EPREFIX}${arg2} to ${EPREFIX}${arg1} and ${EPREFIX}/etc/sgml/catalog"
46 swegener 1.11 sgml-catalog_cat_doinstall ${arg1} ${arg2}
47     done
48     sgml-catalog_cleanup
49 satai 1.3 }
50    
51     sgml-catalog_pkg_prerm() {
52 swegener 1.11 sgml-catalog_cleanup
53 satai 1.1 }
54    
55 satai 1.2 sgml-catalog_pkg_postrm() {
56 swegener 1.11 debug-print function $FUNCNAME $*
57 darkside 1.15 has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
58 leonardop 1.14
59     for entry in ${SGML_TOINSTALL}; do
60 darkside 1.15 arg1=${entry%%:*}
61     arg2=${entry#*:}
62 floppym 1.18 einfo "Now removing ${EPREFIX}${arg2} from ${EPREFIX}${arg1} and ${EPREFIX}/etc/sgml/catalog"
63 swegener 1.11 sgml-catalog_cat_doremove ${arg1} ${arg2}
64     done
65 satai 1.1 }
66    
67 satai 1.3 sgml-catalog_cleanup() {
68 darkside 1.15 has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
69     if [ -e "${EPREFIX}/usr/bin/gensgmlenv" ]
70 swegener 1.11 then
71     einfo Regenerating SGML environment variables ...
72     gensgmlenv
73 darkside 1.15 grep -v export "${EPREFIX}/etc/sgml/sgml.env" > "${EPREFIX}/etc/env.d/93sgmltools-lite"
74 swegener 1.11 fi
75 satai 1.3 }
76    
77 satai 1.1 sgml-catalog_src_compile() {
78 swegener 1.11 return
79 satai 1.1 }
80    
81 satai 1.3 EXPORT_FUNCTIONS pkg_postrm pkg_postinst src_compile pkg_prerm

  ViewVC Help
Powered by ViewVC 1.1.20