| 1 | # Copyright 1999-2004 Gentoo Foundation |
1 | # Copyright 1999-2004 Gentoo Foundation |
| 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.13 2005/07/15 17:01:14 leonardop Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/sgml-catalog.eclass,v 1.14 2005/09/08 17:37:32 leonardop Exp $ |
| 4 | # |
4 | # |
| 5 | # Author Matthew Turk <satai@gentoo.org> |
5 | # Author Matthew Turk <satai@gentoo.org> |
| 6 | |
6 | |
| 7 | inherit base |
7 | inherit base |
| 8 | |
8 | |
| 9 | DEPEND=">=app-text/sgml-common-0.6.3-r2" |
9 | DEPEND=">=app-text/sgml-common-0.6.3-r2" |
| 10 | |
10 | |
| 11 | declare -a toinstall |
11 | |
| 12 | declare -i catcounter |
12 | # List of catalogs to install |
| 13 | let "catcounter=0" |
13 | SGML_TOINSTALL="" |
|
|
14 | |
| 14 | |
15 | |
| 15 | sgml-catalog_cat_include() { |
16 | sgml-catalog_cat_include() { |
| 16 | debug-print function $FUNCNAME $* |
17 | debug-print function $FUNCNAME $* |
| 17 | toinstall["catcounter++"]="${1}:${2}" |
18 | SGML_TOINSTALL="${SGML_TOINSTALL} ${1}:${2}" |
| 18 | } |
19 | } |
| 19 | |
20 | |
| 20 | sgml-catalog_cat_doinstall() { |
21 | sgml-catalog_cat_doinstall() { |
| 21 | debug-print function $FUNCNAME $* |
22 | debug-print function $FUNCNAME $* |
| 22 | /usr/bin/install-catalog --add $1 $2 &>/dev/null |
23 | /usr/bin/install-catalog --add $1 $2 &>/dev/null |
| … | |
… | |
| 27 | /usr/bin/install-catalog --remove $1 $2 &>/dev/null |
28 | /usr/bin/install-catalog --remove $1 $2 &>/dev/null |
| 28 | } |
29 | } |
| 29 | |
30 | |
| 30 | sgml-catalog_pkg_postinst() { |
31 | sgml-catalog_pkg_postinst() { |
| 31 | debug-print function $FUNCNAME $* |
32 | debug-print function $FUNCNAME $* |
| 32 | declare -i topindex |
33 | |
| 33 | topindex="catcounter-1" |
34 | for entry in ${SGML_TOINSTALL}; do |
| 34 | for i in `seq 0 ${topindex}` |
|
|
| 35 | do |
|
|
| 36 | arg1=`echo ${toinstall[$i]} | cut -f1 -d\:` |
35 | arg1=`echo ${entry} | cut -f1 -d\:` |
| 37 | arg2=`echo ${toinstall[$i]} | cut -f2 -d\:` |
36 | arg2=`echo ${entry} | cut -f2 -d\:` |
| 38 | if [ ! -e ${arg2} ] |
37 | if [ ! -e ${arg2} ] |
| 39 | then |
38 | then |
| 40 | ewarn "${arg2} doesn't appear to exist, although it ought to!" |
39 | ewarn "${arg2} doesn't appear to exist, although it ought to!" |
| 41 | continue |
40 | continue |
| 42 | fi |
41 | fi |
| … | |
… | |
| 50 | sgml-catalog_cleanup |
49 | sgml-catalog_cleanup |
| 51 | } |
50 | } |
| 52 | |
51 | |
| 53 | sgml-catalog_pkg_postrm() { |
52 | sgml-catalog_pkg_postrm() { |
| 54 | debug-print function $FUNCNAME $* |
53 | debug-print function $FUNCNAME $* |
| 55 | declare -i topindex |
54 | |
| 56 | topindex="catcounter-1" |
55 | for entry in ${SGML_TOINSTALL}; do |
| 57 | for i in `seq 0 ${topindex}` |
|
|
| 58 | do |
|
|
| 59 | arg1=`echo ${toinstall[$i]} | cut -f1 -d\:` |
56 | arg1=`echo ${entry} | cut -f1 -d\:` |
| 60 | arg2=`echo ${toinstall[$i]} | cut -f2 -d\:` |
57 | arg2=`echo ${entry} | cut -f2 -d\:` |
| 61 | if [ -e ${arg2} ] |
58 | if [ -e ${arg2} ] |
| 62 | then |
59 | then |
| 63 | ewarn "${arg2} still exists! Not removing from ${arg1}" |
60 | ewarn "${arg2} still exists! Not removing from ${arg1}" |
| 64 | ewarn "This is normal behavior for an upgrade ..." |
61 | ewarn "This is normal behavior for an upgrade ..." |
| 65 | continue |
62 | continue |