summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeonardo Boshell <leonardop@gentoo.org>2006-01-14 14:02:33 +0000
committerLeonardo Boshell <leonardop@gentoo.org>2006-01-14 14:02:33 +0000
commitb375f4d7b5ef8f7b7383d672e21c32680f1feb18 (patch)
tree6542ca407e5186883202885d30ced54d4ce9b556 /app-text/sgml-common
parentTell configure that we do not want josua with permission from dragonheart (diff)
downloadgentoo-2-b375f4d7b5ef8f7b7383d672e21c32680f1feb18.tar.gz
gentoo-2-b375f4d7b5ef8f7b7383d672e21c32680f1feb18.tar.bz2
gentoo-2-b375f4d7b5ef8f7b7383d672e21c32680f1feb18.zip
Support for $ROOT values other than / (bug #114946)
(Portage version: 2.1_pre3-r1)
Diffstat (limited to 'app-text/sgml-common')
-rw-r--r--app-text/sgml-common/ChangeLog10
-rw-r--r--app-text/sgml-common/files/sgml-common-0.6.3-r4-install-catalog.in51
-rw-r--r--app-text/sgml-common/sgml-common-0.6.3-r4.ebuild50
3 files changed, 66 insertions, 45 deletions
diff --git a/app-text/sgml-common/ChangeLog b/app-text/sgml-common/ChangeLog
index adbe7b4eae97..fe3bee9066f2 100644
--- a/app-text/sgml-common/ChangeLog
+++ b/app-text/sgml-common/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for app-text/sgml-common
-# Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-text/sgml-common/ChangeLog,v 1.31 2005/01/02 22:45:04 ciaranm Exp $
+# Copyright 2002-2006 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/app-text/sgml-common/ChangeLog,v 1.32 2006/01/14 14:02:33 leonardop Exp $
+
+ 14 Jan 2006; Leonardo Boshell <leonardop@gentoo.org>
+ files/sgml-common-0.6.3-r4-install-catalog.in,
+ sgml-common-0.6.3-r4.ebuild:
+ Modified ebuild and install-catalog script to handle $ROOT values different
+ than "/". See bug #114946.
02 Jan 2005; Ciaran McCreesh <ciaranm@gentoo.org> :
Change encoding to UTF-8 for GLEP 31 compliance
diff --git a/app-text/sgml-common/files/sgml-common-0.6.3-r4-install-catalog.in b/app-text/sgml-common/files/sgml-common-0.6.3-r4-install-catalog.in
index 71507a327604..9014d0ebb232 100644
--- a/app-text/sgml-common/files/sgml-common-0.6.3-r4-install-catalog.in
+++ b/app-text/sgml-common/files/sgml-common-0.6.3-r4-install-catalog.in
@@ -3,6 +3,9 @@
# Send any comments to Eric Bischoff <eric@caldera.de>
# This program is under GPL license. See LICENSE file for details.
+# Modified by Gentoo developers to better integrate it to portage.
+# <text-markup@gentoo.org>
+
# Set help message
SGML_HELP_MESSAGE="Usage: `basename $0` [<option>] <action>\n\
where <option> is:\n\
@@ -26,6 +29,11 @@ SGML_ACTION=""
SGML_CENTRALIZED=""
SGML_ORDINARY=""
+# Default ROOT value (usually defined by portage)
+[ -z "$ROOT" ] && ROOT="/"
+[[ $ROOT == */ ]] || ROOT="${ROOT}/"
+
+
# Process options
case $1 in
-d|--delegate) SGML_POINTER="DELEGATE"
@@ -62,6 +70,14 @@ case $1 in
;;
esac
+
+# The arguments to this program should always be relative to $ROOT. Here we
+# declare some extra variables to distingish between the absolute and
+# relative paths.
+SGML_ROOT_CENTRALIZED="${ROOT%/}${SGML_CENTRALIZED}"
+SGML_ROOT_ORDINARY="${ROOT%/}${SGML_ORDINARY}"
+
+
# Check that the super catalog can be created and changed and deleted
if [ ! -w ${ROOT}etc/sgml ]
then
@@ -86,39 +102,39 @@ case $SGML_ACTION in
esac
# Check that the centralized catalog can be created, changed and deleted
-if [ -z "$SGML_CENTRALIZED" ]
+if [ -z "$SGML_ROOT_CENTRALIZED" ]
then
echo -e $SGML_HELP_MESSAGE >&2
exit 1
fi
case $SGML_ACTION in
addition)
- if [ -e $SGML_CENTRALIZED -a ! -w $SGML_CENTRALIZED ]
+ if [ -e "$SGML_ROOT_CENTRALIZED" -a ! -w "$SGML_ROOT_CENTRALIZED" ]
then
- echo "`basename $0`: can not modify \"$SGML_CENTRALIZED\"." >&2
+ echo "`basename $0`: can not modify \"$SGML_ROOT_CENTRALIZED\"." >&2
exit 2
fi
;;
removal)
- if [ ! -w $SGML_CENTRALIZED ]
+ if [ ! -w "$SGML_ROOT_CENTRALIZED" ]
then
- echo "`basename $0`: can not modify \"$SGML_CENTRALIZED\"." >&2
+ echo "`basename $0`: can not modify \"$SGML_ROOT_CENTRALIZED\"." >&2
exit 2
fi
;;
esac
# Check that we have at least one ordinary package to process
-if [ -z "$SGML_ORDINARY" ]
+if [ -z "$SGML_ROOT_ORDINARY" ]
then
echo -e $SGML_HELP_MESSAGE >&2
exit 1
fi
case $SGML_ACTION in
addition)
- if [ ! -s $SGML_ORDINARY ]
+ if [ ! -s $SGML_ROOT_ORDINARY ]
then
- echo "`basename $0`: \"$SGML_ORDINARY\" does not exist or is empty." >&2
+ echo "`basename $0`: \"$SGML_ROOT_ORDINARY\" does not exist or is empty." >&2
exit 2
fi
;;
@@ -128,31 +144,32 @@ esac
case $SGML_ACTION in
addition)
echo "`basename $0`: addition of $SGML_ORDINARY in $SGML_CENTRALIZED"
- if grep -q $SGML_ORDINARY $SGML_CENTRALIZED 2>/dev/null
+ if grep -q $SGML_ORDINARY $SGML_ROOT_CENTRALIZED 2>/dev/null
then
echo "Warning: $SGML_ORDINARY is already installed in the centralized catalog $SGML_CENTRALIZED" >&2
else
- echo "$SGML_POINTER \"$SGML_ORDINARY\"" >> $SGML_CENTRALIZED
+ echo "$SGML_POINTER \"$SGML_ORDINARY\"" >> $SGML_ROOT_CENTRALIZED
fi
grep -q $SGML_CENTRALIZED ${ROOT}etc/sgml/catalog 2>/dev/null
if [ $? -ne 0 ]
then
- echo "`basename $0`: addition of $SGML_CENTRALIZED in ${ROOT}etc/sgml/catalog"
- echo "$SGML_POINTER \"$SGML_CENTRALIZED\"" >> ${ROOT}etc/sgml/catalog
+ echo "`basename $0`: addition of $SGML_CENTRALIZED in ${ROOT}etc/sgml/catalog"
+ echo "$SGML_POINTER \"$SGML_CENTRALIZED\"" >> ${ROOT}etc/sgml/catalog
fi
;;
removal)
echo "`basename $0`: removal of $SGML_ORDINARY from $SGML_CENTRALIZED"
- if grep -q $SGML_ORDINARY $SGML_CENTRALIZED 2>/dev/null
+ if grep -q $SGML_ORDINARY $SGML_ROOT_CENTRALIZED 2>/dev/null
then
- sed -e "\:$SGML_POINTER \"$SGML_ORDINARY\":d" < $SGML_CENTRALIZED > ${SGML_CENTRALIZED}.new
- mv ${SGML_CENTRALIZED}.new $SGML_CENTRALIZED
+ sed -e "\:$SGML_POINTER \"$SGML_ORDINARY\":d" < \
+ $SGML_ROOT_CENTRALIZED > ${SGML_ROOT_CENTRALIZED}.new
+ mv ${SGML_ROOT_CENTRALIZED}.new $SGML_ROOT_CENTRALIZED
else
echo "Warning: $SGML_ORDINARY was not found in the centralized catalog $SGML_CENTRALIZED" >&2
fi
- if [ ! -s $SGML_CENTRALIZED ]
+ if [ ! -s "$SGML_ROOT_CENTRALIZED" ]
then
- rm $SGML_CENTRALIZED
+ rm $SGML_ROOT_CENTRALIZED
echo "`basename $0`: removal of $SGML_CENTRALIZED from ${ROOT}etc/sgml/catalog"
sed -e "\:$SGML_POINTER \"$SGML_CENTRALIZED\":d" < ${ROOT}etc/sgml/catalog > ${ROOT}etc/sgml/catalog.new
mv ${ROOT}etc/sgml/catalog.new ${ROOT}etc/sgml/catalog
diff --git a/app-text/sgml-common/sgml-common-0.6.3-r4.ebuild b/app-text/sgml-common/sgml-common-0.6.3-r4.ebuild
index 373919137f12..4aa64b1483bd 100644
--- a/app-text/sgml-common/sgml-common-0.6.3-r4.ebuild
+++ b/app-text/sgml-common/sgml-common-0.6.3-r4.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/app-text/sgml-common/sgml-common-0.6.3-r4.ebuild,v 1.29 2006/01/03 01:47:36 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-text/sgml-common/sgml-common-0.6.3-r4.ebuild,v 1.30 2006/01/14 14:02:33 leonardop Exp $
DESCRIPTION="Base ISO character entities and utilities for SGML"
HOMEPAGE="http://www.iso.ch/cate/3524030.html"
@@ -28,23 +28,22 @@ src_install() {
}
pkg_postinst() {
- local file
-
- if [ -x "/usr/bin/install-catalog" ] && [ "$ROOT" = "/" ]
- then
- einfo "Installing Catalogs..."
- install-catalog --add \
- /etc/sgml/sgml-ent.cat \
- /usr/share/sgml/sgml-iso-entities-8879.1986/catalog
-
- install-catalog --add \
- /etc/sgml/sgml-docbook.cat \
- /etc/sgml/sgml-ent.cat
- else
- ewarn "install-catalog not found! Something went wrong!"
+ local installer="${ROOT}usr/bin/install-catalog"
+ if [ ! -x "${installer}" ]; then
+ eerror "install-catalog not found! Something went wrong!"
die
fi
- for file in `find /etc/sgml/ -name "*.cat"` /etc/sgml/catalog
+
+ einfo "Installing Catalogs..."
+ $installer --add \
+ /etc/sgml/sgml-ent.cat \
+ /usr/share/sgml/sgml-iso-entities-8879.1986/catalog
+ $installer --add \
+ /etc/sgml/sgml-docbook.cat \
+ /etc/sgml/sgml-ent.cat
+
+ local file
+ for file in `find ${ROOT}etc/sgml/ -name "*.cat"` ${ROOT}etc/sgml/catalog
do
einfo "Fixing ${file}"
awk '/"$/ { print $1 " " $2 }
@@ -54,25 +53,24 @@ pkg_postinst() {
}
pkg_prerm() {
- cp /usr/bin/install-catalog ${T}
+ cp ${ROOT}usr/bin/install-catalog ${T}
}
pkg_postrm() {
- if [ ! -x "/usr/bin/install-catalog" ] && [ "$ROOT" = "/" ]
- then
- einfo "Removing Catalogs..."
- if [ -e /etc/sgml/sgml-ent.cat ]
- then
+ if [ ! -x "${T}/install-catalog" ]; then
+ return
+ fi
+
+ einfo "Removing Catalogs..."
+ if [ -e "${ROOT}etc/sgml/sgml-ent.cat" ]; then
${T}/install-catalog --remove \
/etc/sgml/sgml-ent.cat \
/usr/share/sgml/sgml-iso-entities-8879.1986/catalog
- fi
+ fi
- if [ -e /etc/sgml/sgml-docbook.cat ]
- then
+ if [ -e "${ROOT}etc/sgml/sgml-docbook.cat" ]; then
${T}/install-catalog --remove \
/etc/sgml/sgml-docbook.cat \
/etc/sgml/sgml-ent.cat
- fi
fi
}