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

Contents of /eclass/sgml-catalog.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.15 - (hide annotations) (download)
Thu May 13 21:38:11 2010 UTC (4 years, 4 months ago) by darkside
Branch: MAIN
Changes since 1.14: +20 -15 lines
sgml-catalog.eclass: Add EAPI3/Gentoo Prefix support. bug 310777

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 darkside 1.15 # $Header: /var/cvsroot/gentoo-x86/eclass/sgml-catalog.eclass,v 1.14 2005/09/08 17:37:32 leonardop 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     "${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     "${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     if [ -e "${EPREFIX}"${arg2} ]
63 swegener 1.11 then
64 darkside 1.15 ewarn "${EPREFIX}${arg2} still exists! Not removing from ${EPREFIX}${arg1}"
65 swegener 1.11 ewarn "This is normal behavior for an upgrade ..."
66     continue
67     fi
68 darkside 1.15 einfo "Now removing ${EPREFIX}${arg1} from ${EPREFIX}${arg2} and ${EPREFIX}/etc/sgml/catalog"
69 swegener 1.11 sgml-catalog_cat_doremove ${arg1} ${arg2}
70     done
71 satai 1.1 }
72    
73 satai 1.3 sgml-catalog_cleanup() {
74 darkside 1.15 has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
75     if [ -e "${EPREFIX}/usr/bin/gensgmlenv" ]
76 swegener 1.11 then
77     einfo Regenerating SGML environment variables ...
78     gensgmlenv
79 darkside 1.15 grep -v export "${EPREFIX}/etc/sgml/sgml.env" > "${EPREFIX}/etc/env.d/93sgmltools-lite"
80 swegener 1.11 fi
81 satai 1.3 }
82    
83 satai 1.1 sgml-catalog_src_compile() {
84 swegener 1.11 return
85 satai 1.1 }
86    
87 satai 1.3 EXPORT_FUNCTIONS pkg_postrm pkg_postinst src_compile pkg_prerm

  ViewVC Help
Powered by ViewVC 1.1.20