summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeonardo Boshell <leonardop@gentoo.org>2005-07-15 13:50:19 +0000
committerLeonardo Boshell <leonardop@gentoo.org>2005-07-15 13:50:19 +0000
commit9cf581a35c0c971c572292d4be3987c4fca42d90 (patch)
tree26bc1b91ca74cb5844d959c1591efd9220e2b8e9 /eclass/sgml-catalog.eclass
parentDep fixes (diff)
downloadgentoo-2-9cf581a35c0c971c572292d4be3987c4fca42d90.tar.gz
gentoo-2-9cf581a35c0c971c572292d4be3987c4fca42d90.tar.bz2
gentoo-2-9cf581a35c0c971c572292d4be3987c4fca42d90.zip
* sgml-catalog_cat_include(), sgml-catalog_pkg_postinst(),
sgml-catalog_pkg_postrm(): Implemented a different logic to keep track of the catalogs to install/remove, since the previous one caused problems if sgml-catalog_cat_include() was called from pkg_setup(). See bug #98680.
Diffstat (limited to 'eclass/sgml-catalog.eclass')
-rw-r--r--eclass/sgml-catalog.eclass41
1 files changed, 25 insertions, 16 deletions
diff --git a/eclass/sgml-catalog.eclass b/eclass/sgml-catalog.eclass
index b84e1bd31987..5c12985ed262 100644
--- a/eclass/sgml-catalog.eclass
+++ b/eclass/sgml-catalog.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/sgml-catalog.eclass,v 1.11 2005/07/11 15:08:06 swegener Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/sgml-catalog.eclass,v 1.12 2005/07/15 13:50:19 leonardop Exp $
#
# Author Matthew Turk <satai@gentoo.org>
@@ -8,13 +8,16 @@ inherit base
DEPEND=">=app-text/sgml-common-0.6.3-r2"
-declare -a toinstall
-declare -i catcounter
-let "catcounter=0"
-
sgml-catalog_cat_include() {
+ [ -z "${WORKDIR}" ] && return
+
+ local catalogdir="${WORKDIR}/catalogs"
+ local catalogfile="${catalogdir}/data"
+
debug-print function $FUNCNAME $*
- toinstall["catcounter++"]="${1}:${2}"
+
+ [ ! -d "$catalogdir" ] && mkdir -p $catalogdir
+ echo "${1}:${2}" >> $catalogfile
}
sgml-catalog_cat_doinstall() {
@@ -28,13 +31,16 @@ sgml-catalog_cat_doremove() {
}
sgml-catalog_pkg_postinst() {
+ local catalogdir="${WORKDIR}/catalogs"
+ local catalogfile="${catalogdir}/data"
+
debug-print function $FUNCNAME $*
- declare -i topindex
- topindex="catcounter-1"
- for i in `seq 0 ${topindex}`
+
+ local toinstall
+ cat ${catalogfile} | while read toinstall
do
- arg1=`echo ${toinstall[$i]} | cut -f1 -d\:`
- arg2=`echo ${toinstall[$i]} | cut -f2 -d\:`
+ arg1=`echo ${toinstall} | cut -f1 -d\:`
+ arg2=`echo ${toinstall} | cut -f2 -d\:`
if [ ! -e ${arg2} ]
then
ewarn "${arg2} doesn't appear to exist, although it ought to!"
@@ -51,13 +57,16 @@ sgml-catalog_pkg_prerm() {
}
sgml-catalog_pkg_postrm() {
+ local catalogdir="${WORKDIR}/catalogs"
+ local catalogfile="${catalogdir}/data"
+
debug-print function $FUNCNAME $*
- declare -i topindex
- topindex="catcounter-1"
- for i in `seq 0 ${topindex}`
+
+ local toinstall
+ cat ${catalogfile} | while read toinstall
do
- arg1=`echo ${toinstall[$i]} | cut -f1 -d\:`
- arg2=`echo ${toinstall[$i]} | cut -f2 -d\:`
+ arg1=`echo ${toinstall} | cut -f1 -d\:`
+ arg2=`echo ${toinstall} | cut -f2 -d\:`
if [ -e ${arg2} ]
then
ewarn "${arg2} still exists! Not removing from ${arg1}"