| 1 | # Copyright 1999-2002 Gentoo Technologies, Inc. |
1 | # Copyright 1999-2003 Gentoo Technologies, Inc. |
| 2 | # Distributed under the terms of the GNU General Public License v2 |
2 | # Distributed under the terms of the GNU General Public License v2 |
|
|
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/sgml-catalog.eclass,v 1.7 2004/04/10 13:02:38 usata Exp $ |
|
|
4 | # |
| 3 | # Author Matthew Turk <satai@gentoo.org> |
5 | # Author Matthew Turk <satai@gentoo.org> |
| 4 | # $Header: /var/cvsroot/gentoo-x86/eclass/sgml-catalog.eclass,v 1.1 2002/12/31 04:35:01 satai Exp $ |
|
|
| 5 | # |
|
|
| 6 | |
6 | |
| 7 | inherit base |
7 | inherit base |
| 8 | INHERITED="$INHERITED $ECLASS" |
8 | INHERITED="$INHERITED $ECLASS" |
| 9 | |
9 | |
| 10 | newdepend ">=sgml-common-0.6.3-r2" |
10 | DEPEND=">=app-text/sgml-common-0.6.3-r2" |
| 11 | ECLASS=sgml-catalog |
11 | ECLASS=sgml-catalog |
| 12 | |
12 | |
| 13 | declare -a toinstall |
13 | declare -a toinstall |
| 14 | declare -i catcounter |
14 | declare -i catcounter |
| 15 | let "catcounter=0" |
15 | let "catcounter=0" |
| … | |
… | |
| 35 | topindex="catcounter-1" |
35 | topindex="catcounter-1" |
| 36 | for i in `seq 0 ${topindex}` |
36 | for i in `seq 0 ${topindex}` |
| 37 | do |
37 | do |
| 38 | arg1=`echo ${toinstall[$i]} | cut -f1 -d\:` |
38 | arg1=`echo ${toinstall[$i]} | cut -f1 -d\:` |
| 39 | arg2=`echo ${toinstall[$i]} | cut -f2 -d\:` |
39 | arg2=`echo ${toinstall[$i]} | cut -f2 -d\:` |
|
|
40 | if [ ! -e $arg2 ] |
|
|
41 | then |
|
|
42 | ewarn "${arg2} doesn't appear to exist, although it ought to!" |
|
|
43 | continue |
|
|
44 | fi |
| 40 | einfo "Now adding $arg1 to $arg2 and /etc/sgml/catalog" |
45 | einfo "Now adding $arg2 to $arg1 and /etc/sgml/catalog" |
| 41 | sgml-catalog_cat_doinstall $arg1 $arg2 |
46 | sgml-catalog_cat_doinstall $arg1 $arg2 |
| 42 | done |
47 | done |
|
|
48 | sgml-catalog_cleanup |
| 43 | } |
49 | } |
| 44 | |
50 | |
| 45 | sgml-catalog_pkg_prerm() { |
51 | sgml-catalog_pkg_prerm() { |
|
|
52 | sgml-catalog_cleanup |
|
|
53 | } |
|
|
54 | |
|
|
55 | sgml-catalog_pkg_postrm() { |
| 46 | debug-print function $FUNCNAME $* |
56 | debug-print function $FUNCNAME $* |
| 47 | declare -i topindex |
57 | declare -i topindex |
| 48 | topindex="catcounter-1" |
58 | topindex="catcounter-1" |
| 49 | for i in `seq 0 ${topindex}` |
59 | for i in `seq 0 ${topindex}` |
| 50 | do |
60 | do |
| 51 | arg1=`echo ${toinstall[$i]} | cut -f1 -d\:` |
61 | arg1=`echo ${toinstall[$i]} | cut -f1 -d\:` |
| 52 | arg2=`echo ${toinstall[$i]} | cut -f2 -d\:` |
62 | arg2=`echo ${toinstall[$i]} | cut -f2 -d\:` |
|
|
63 | if [ -e $arg2 ] |
|
|
64 | then |
|
|
65 | ewarn "${arg2} still exists! Not removing from ${arg1}" |
|
|
66 | ewarn "This is normal behavior for an upgrade..." |
|
|
67 | continue |
|
|
68 | fi |
| 53 | einfo "Now removing $arg1 from $arg2 and /etc/sgml/catalog" |
69 | einfo "Now removing $arg1 from $arg2 and /etc/sgml/catalog" |
| 54 | sgml-catalog_cat_doremove $arg1 $arg2 |
70 | sgml-catalog_cat_doremove $arg1 $arg2 |
| 55 | done |
71 | done |
| 56 | } |
72 | } |
| 57 | |
73 | |
| 58 | sgml-catalog_src_compile() { |
74 | sgml-catalog_cleanup() { |
| 59 | dummy="DUMMY" |
75 | if [ -e /usr/bin/gensgmlenv ] |
|
|
76 | then |
|
|
77 | einfo Regenerating SGML environment variables... |
|
|
78 | gensgmlenv |
|
|
79 | grep -v export /etc/sgml/sgml.env > /etc/env.d/93sgmltools-lite |
|
|
80 | fi |
| 60 | } |
81 | } |
| 61 | |
82 | |
|
|
83 | sgml-catalog_src_compile() { |
|
|
84 | return |
|
|
85 | } |
|
|
86 | |
| 62 | EXPORT_FUNCTIONS pkg_prerm pkg_postinst src_compile |
87 | EXPORT_FUNCTIONS pkg_postrm pkg_postinst src_compile pkg_prerm |