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

Diff of /eclass/sgml-catalog.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.13 Revision 1.14
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
7inherit base 7inherit base
8 8
9DEPEND=">=app-text/sgml-common-0.6.3-r2" 9DEPEND=">=app-text/sgml-common-0.6.3-r2"
10 10
11declare -a toinstall 11
12declare -i catcounter 12# List of catalogs to install
13let "catcounter=0" 13SGML_TOINSTALL=""
14
14 15
15sgml-catalog_cat_include() { 16sgml-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
20sgml-catalog_cat_doinstall() { 21sgml-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
30sgml-catalog_pkg_postinst() { 31sgml-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
53sgml-catalog_pkg_postrm() { 52sgml-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

Legend:
Removed from v.1.13  
changed lines
  Added in v.1.14

  ViewVC Help
Powered by ViewVC 1.1.20