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

Contents of /eclass/sgml-catalog.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.20 - (hide annotations) (download)
Sun Apr 29 23:25:05 2012 UTC (23 months, 2 weeks ago) by flameeyes
Branch: MAIN
CVS Tags: HEAD
Changes since 1.19: +2 -1 lines
Fix infinite look if the catalog is corrupted.

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 flameeyes 1.20 # $Header: /var/cvsroot/gentoo-x86/eclass/sgml-catalog.eclass,v 1.19 2012/03/23 07:30:54 floppym Exp $
4 floppym 1.19
5     # @ECLASS: sgml-catalog.eclass
6     # @MAINTAINER:
7     # SGML Herd <sgml@gentoo.org>
8     # @AUTHOR:
9 satai 1.1 # Author Matthew Turk <satai@gentoo.org>
10 floppym 1.19 # @BLURB: Functions for installing SGML catalogs
11 satai 1.1
12     inherit base
13    
14 usata 1.7 DEPEND=">=app-text/sgml-common-0.6.3-r2"
15 satai 1.1
16 floppym 1.19 # @ECLASS-VARIABLE: SGML_TOINSTALL
17     # @DESCRIPTION:
18     # An array of catalogs, arranged in pairs.
19     # Each pair consists of a centralized catalog followed by an ordinary catalog.
20     SGML_TOINSTALL=()
21    
22     # @FUNCTION: sgml-catalog_cat_include
23     # @USAGE: <centralized catalog> <ordinary catalog>
24     # @DESCRIPTION:
25     # Appends a catalog pair to the SGML_TOINSTALL array.
26 leonardop 1.12 sgml-catalog_cat_include() {
27 swegener 1.11 debug-print function $FUNCNAME $*
28 floppym 1.19 SGML_TOINSTALL+=("$1" "$2")
29 satai 1.1 }
30    
31 floppym 1.19 # @FUNCTION: sgml-catalog_cat_doinstall
32     # @USAGE: <centralized catalog> <ordinary catalog>
33     # @DESCRIPTION:
34     # Adds an ordinary catalog to a centralized catalog.
35 satai 1.1 sgml-catalog_cat_doinstall() {
36 swegener 1.11 debug-print function $FUNCNAME $*
37 darkside 1.15 has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
38 abcd 1.16 "${EPREFIX}"/usr/bin/install-catalog --add "${EPREFIX}$1" "${EPREFIX}$2" &>/dev/null
39 satai 1.1 }
40    
41 floppym 1.19 # @FUNCTION: sgml-catalog_cat_doremove
42     # @USAGE: <centralized catalog> <ordinary catalog>
43     # @DESCRIPTION:
44     # Removes an ordinary catalog from a centralized catalog.
45 satai 1.1 sgml-catalog_cat_doremove() {
46 swegener 1.11 debug-print function $FUNCNAME $*
47 darkside 1.15 has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
48 abcd 1.16 "${EPREFIX}"/usr/bin/install-catalog --remove "${EPREFIX}$1" "${EPREFIX}$2" &>/dev/null
49 satai 1.1 }
50    
51     sgml-catalog_pkg_postinst() {
52 swegener 1.11 debug-print function $FUNCNAME $*
53 darkside 1.15 has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
54 leonardop 1.14
55 floppym 1.19 set -- "${SGML_TOINSTALL[@]}"
56    
57     while (( $# )); do
58     if [[ ! -e "${EPREFIX}$2" ]]; then
59     ewarn "${EPREFIX}$2 doesn't appear to exist, although it ought to!"
60 flameeyes 1.20 shift 2
61 swegener 1.11 continue
62     fi
63 floppym 1.19 einfo "Now adding ${EPREFIX}$2 to ${EPREFIX}$1 and ${EPREFIX}/etc/sgml/catalog"
64     sgml-catalog_cat_doinstall "$1" "$2"
65     shift 2
66 swegener 1.11 done
67     sgml-catalog_cleanup
68 satai 1.3 }
69    
70     sgml-catalog_pkg_prerm() {
71 swegener 1.11 sgml-catalog_cleanup
72 satai 1.1 }
73    
74 satai 1.2 sgml-catalog_pkg_postrm() {
75 swegener 1.11 debug-print function $FUNCNAME $*
76 darkside 1.15 has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
77 leonardop 1.14
78 floppym 1.19 set -- "${SGML_TOINSTALL[@]}"
79    
80     while (( $# )); do
81     einfo "Now removing ${EPREFIX}$2 from ${EPREFIX}$1 and ${EPREFIX}/etc/sgml/catalog"
82     sgml-catalog_cat_doremove "$1" "$2"
83     shift 2
84 swegener 1.11 done
85 satai 1.1 }
86    
87 satai 1.3 sgml-catalog_cleanup() {
88 darkside 1.15 has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
89     if [ -e "${EPREFIX}/usr/bin/gensgmlenv" ]
90 swegener 1.11 then
91     einfo Regenerating SGML environment variables ...
92     gensgmlenv
93 darkside 1.15 grep -v export "${EPREFIX}/etc/sgml/sgml.env" > "${EPREFIX}/etc/env.d/93sgmltools-lite"
94 swegener 1.11 fi
95 satai 1.3 }
96    
97 satai 1.1 sgml-catalog_src_compile() {
98 swegener 1.11 return
99 satai 1.1 }
100    
101 satai 1.3 EXPORT_FUNCTIONS pkg_postrm pkg_postinst src_compile pkg_prerm

  ViewVC Help
Powered by ViewVC 1.1.20