summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2012-12-15 21:30:03 +0000
committerMichał Górny <mgorny@gentoo.org>2012-12-15 21:30:03 +0000
commitca9744301966ce1a0235b40cf5f4860d54cf03ed (patch)
treeec93ae545587dee2846486eaf3c2b3d8c3ed3b9d /eclass/python-utils-r1.eclass
parentVersion bump (diff)
downloadgentoo-2-ca9744301966ce1a0235b40cf5f4860d54cf03ed.tar.gz
gentoo-2-ca9744301966ce1a0235b40cf5f4860d54cf03ed.tar.bz2
gentoo-2-ca9744301966ce1a0235b40cf5f4860d54cf03ed.zip
Fix the relative linking algo to handle /// in path.
Diffstat (limited to 'eclass/python-utils-r1.eclass')
-rw-r--r--eclass/python-utils-r1.eclass22
1 files changed, 12 insertions, 10 deletions
diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index 64848a7e5573..0f342b7ad2c2 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/python-utils-r1.eclass,v 1.6 2012/12/01 22:10:34 mgorny Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/python-utils-r1.eclass,v 1.7 2012/12/15 21:30:03 mgorny Exp $
# @ECLASS: python-utils-r1
# @MAINTAINER:
@@ -270,20 +270,22 @@ _python_ln_rel() {
local topath=${to%/*}/
local rel_path=
- # remove double slashes
- frpath=${frpath/\/\///}
- topath=${topath/\/\///}
-
while [[ ${topath} ]]; do
- local frseg=${frpath%%/*}
- local toseg=${topath%%/*}
+ local frseg= toseg=
+
+ while [[ ! ${frseg} && ${frpath} ]]; do
+ frseg=${frpath%%/*}
+ frpath=${frpath#${frseg}/}
+ done
+
+ while [[ ! ${toseg} && ${topath} ]]; do
+ toseg=${topath%%/*}
+ topath=${topath#${toseg}/}
+ done
if [[ ${frseg} != ${toseg} ]]; then
rel_path=../${rel_path}${frseg:+${frseg}/}
fi
-
- frpath=${frpath#${frseg}/}
- topath=${topath#${toseg}/}
done
rel_path+=${frpath}${1##*/}