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

Contents of /eclass/sgml-catalog.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.18 - (show annotations) (download)
Fri Mar 23 06:16:15 2012 UTC (2 years, 6 months 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 # Copyright 1999-2012 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.17 2011/12/27 17:55:12 fauli 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 has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
24 "${EPREFIX}"/usr/bin/install-catalog --add "${EPREFIX}$1" "${EPREFIX}$2" &>/dev/null
25 }
26
27 sgml-catalog_cat_doremove() {
28 debug-print function $FUNCNAME $*
29 has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
30 "${EPREFIX}"/usr/bin/install-catalog --remove "${EPREFIX}$1" "${EPREFIX}$2" &>/dev/null
31 }
32
33 sgml-catalog_pkg_postinst() {
34 debug-print function $FUNCNAME $*
35 has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
36
37 for entry in ${SGML_TOINSTALL}; do
38 arg1=${entry%%:*}
39 arg2=${entry#*:}
40 if [ ! -e "${EPREFIX}"${arg2} ]
41 then
42 ewarn "${EPREFIX}${arg2} doesn't appear to exist, although it ought to!"
43 continue
44 fi
45 einfo "Now adding ${EPREFIX}${arg2} to ${EPREFIX}${arg1} and ${EPREFIX}/etc/sgml/catalog"
46 sgml-catalog_cat_doinstall ${arg1} ${arg2}
47 done
48 sgml-catalog_cleanup
49 }
50
51 sgml-catalog_pkg_prerm() {
52 sgml-catalog_cleanup
53 }
54
55 sgml-catalog_pkg_postrm() {
56 debug-print function $FUNCNAME $*
57 has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
58
59 for entry in ${SGML_TOINSTALL}; do
60 arg1=${entry%%:*}
61 arg2=${entry#*:}
62 einfo "Now removing ${EPREFIX}${arg2} from ${EPREFIX}${arg1} and ${EPREFIX}/etc/sgml/catalog"
63 sgml-catalog_cat_doremove ${arg1} ${arg2}
64 done
65 }
66
67 sgml-catalog_cleanup() {
68 has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
69 if [ -e "${EPREFIX}/usr/bin/gensgmlenv" ]
70 then
71 einfo Regenerating SGML environment variables ...
72 gensgmlenv
73 grep -v export "${EPREFIX}/etc/sgml/sgml.env" > "${EPREFIX}/etc/env.d/93sgmltools-lite"
74 fi
75 }
76
77 sgml-catalog_src_compile() {
78 return
79 }
80
81 EXPORT_FUNCTIONS pkg_postrm pkg_postinst src_compile pkg_prerm

  ViewVC Help
Powered by ViewVC 1.1.20