aboutsummaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorDenis Dupeyron <calchan@gentoo.org>2013-02-14 09:31:30 -0700
committerDenis Dupeyron <calchan@gentoo.org>2013-02-14 09:31:30 -0700
commit68b75e8da7291f48da953d94b7dfdfbd56cdc857 (patch)
treef5873936dd278a61c9e0beabb3cd90f6f2acc88a /eclass
parentPrepare alternatives-2.eclass for the main tree (diff)
downloadsci-68b75e8da7291f48da953d94b7dfdfbd56cdc857.tar.gz
sci-68b75e8da7291f48da953d94b7dfdfbd56cdc857.tar.bz2
sci-68b75e8da7291f48da953d94b7dfdfbd56cdc857.zip
Fix probable trailing / in EROOT
Diffstat (limited to 'eclass')
-rw-r--r--eclass/alternatives-2.eclass18
1 files changed, 9 insertions, 9 deletions
diff --git a/eclass/alternatives-2.eclass b/eclass/alternatives-2.eclass
index 16caa51d7..7908fe21a 100644
--- a/eclass/alternatives-2.eclass
+++ b/eclass/alternatives-2.eclass
@@ -95,7 +95,7 @@ alternatives_for() {
}
cleanup_old_alternatives_module() {
- local alt=${1} old_module="${EROOT}/usr/share/eselect/modules/${alt}.eselect"
+ local alt=${1} old_module="${EROOT%/}/usr/share/eselect/modules/${alt}.eselect"
if [[ -f "${old_module}" && "$(source "${old_module}" &>/dev/null; echo "${ALTERNATIVE}")" == "${alt}" ]]; then
local version="$(source "${old_module}" &>/dev/null; echo "${VERSION}")"
if [[ "${version}" == "0.1" || "${version}" == "20080924" ]]; then
@@ -110,14 +110,14 @@ alternatives-2_pkg_postinst() {
for a in "${ALTERNATIVES_PROVIDED[@]}"; do
alt="${a%:*}"
provider="${a#*:}"
- if [[ ! -f "${EROOT}/usr/share/eselect/modules/auto/${alt}.eselect" \
- || "$(source "${EROOT}/usr/share/eselect/modules/auto/${alt}.eselect" &>/dev/null; echo "${VERSION}")" \
+ if [[ ! -f "${EROOT%/}/usr/share/eselect/modules/auto/${alt}.eselect" \
+ || "$(source "${EROOT%/}/usr/share/eselect/modules/auto/${alt}.eselect" &>/dev/null; echo "${VERSION}")" \
-ne "${module_version}" ]]; then
#einfo "Creating alternatives module for ${alt}"
- if [[ ! -d ${EROOT}/usr/share/eselect/modules/auto ]]; then
- install -d "${EROOT}"/usr/share/eselect/modules/auto || eerror "Could not create eselect modules dir"
+ if [[ ! -d ${EROOT%/}/usr/share/eselect/modules/auto ]]; then
+ install -d "${EROOT%/}"/usr/share/eselect/modules/auto || eerror "Could not create eselect modules dir"
fi
- cat > "${EROOT}/usr/share/eselect/modules/auto/${alt}.eselect" <<-EOF
+ cat > "${EROOT%/}/usr/share/eselect/modules/auto/${alt}.eselect" <<-EOF
# This module was automatically generated by alternatives.eclass
DESCRIPTION="Alternatives for ${alt}"
VERSION="${module_version}"
@@ -150,9 +150,9 @@ alternatives-2_pkg_prerm() {
einfo "Removed ${provider} alternative module for ${alt}, current is $(eselect ${alt} show)"
if [[ $? -eq 2 ]]; then
einfo "Cleaning up unused alternatives module for ${alt}"
- echo rm "${EROOT}/usr/share/eselect/modules/auto/${alt}.eselect"
- rm "${EROOT}/usr/share/eselect/modules/auto/${alt}.eselect" ||
- eerror rm "${EROOT}/usr/share/eselect/modules/auto/${alt}.eselect" failed
+ echo rm "${EROOT%/}/usr/share/eselect/modules/auto/${alt}.eselect"
+ rm "${EROOT%/}/usr/share/eselect/modules/auto/${alt}.eselect" ||
+ eerror rm "${EROOT%/}/usr/share/eselect/modules/auto/${alt}.eselect" failed
fi
done
}