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

Contents of /eclass/sgml-catalog.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.17 - (show annotations) (download)
Tue Dec 27 17:55:12 2011 UTC (2 years, 9 months ago) by fauli
Branch: MAIN
Changes since 1.16: +2 -2 lines
Update copyright years in headers

1 # Copyright 1999-2011 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.16 2010/06/16 03:36:06 abcd 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 if [ -e "${EPREFIX}"${arg2} ]
63 then
64 ewarn "${EPREFIX}${arg2} still exists! Not removing from ${EPREFIX}${arg1}"
65 ewarn "This is normal behavior for an upgrade ..."
66 continue
67 fi
68 einfo "Now removing ${EPREFIX}${arg1} from ${EPREFIX}${arg2} and ${EPREFIX}/etc/sgml/catalog"
69 sgml-catalog_cat_doremove ${arg1} ${arg2}
70 done
71 }
72
73 sgml-catalog_cleanup() {
74 has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
75 if [ -e "${EPREFIX}/usr/bin/gensgmlenv" ]
76 then
77 einfo Regenerating SGML environment variables ...
78 gensgmlenv
79 grep -v export "${EPREFIX}/etc/sgml/sgml.env" > "${EPREFIX}/etc/env.d/93sgmltools-lite"
80 fi
81 }
82
83 sgml-catalog_src_compile() {
84 return
85 }
86
87 EXPORT_FUNCTIONS pkg_postrm pkg_postinst src_compile pkg_prerm

  ViewVC Help
Powered by ViewVC 1.1.20