diff options
author | Ulrich Müller <ulm@gentoo.org> | 2010-02-26 21:13:00 +0000 |
---|---|---|
committer | Ulrich Müller <ulm@gentoo.org> | 2010-02-26 21:13:00 +0000 |
commit | 5b41d6d517d7b94f6ece6179ac1bb5d07e6e1012 (patch) | |
tree | de40d1056fe677e0d095909f98e01e21ae95a850 | |
parent | Update year. (diff) | |
download | eselect-5b41d6d517d7b94f6ece6179ac1bb5d07e6e1012.tar.gz eselect-5b41d6d517d7b94f6ece6179ac1bb5d07e6e1012.tar.bz2 eselect-5b41d6d517d7b94f6ece6179ac1bb5d07e6e1012.zip |
Fix handling of ROOT in symlinks, bug 260593.
svn path=/trunk/extern/; revision=766
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | modules/vi.eselect | 17 |
2 files changed, 14 insertions, 8 deletions
@@ -1,3 +1,8 @@ +2010-02-26 Ulrich Mueller <ulm@gentoo.org> + + * modules/vi.eselect (set_symlinks): Fix handling of ROOT in + symlinks, bug 260593. + 2010-02-03 Ryan Hill <dirtyepic@gentoo.org> * AUTHORS: Add myself. diff --git a/modules/vi.eselect b/modules/vi.eselect index eb06f33..62cc511 100644 --- a/modules/vi.eselect +++ b/modules/vi.eselect @@ -1,5 +1,5 @@ # -*-eselect-*- vim: ft=eselect -# Copyright 1999-2009 Gentoo Foundation +# Copyright 1999-2010 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Id$ @@ -57,7 +57,7 @@ set_symlinks() { local target="${1}" targets if is_number "${target}" && [[ ${target} -ge 1 ]] ; then targets=( $(find_targets ) ) - target=${targets[$(( ${target} - 1 ))]} + target=${targets[target-1]} fi local dir @@ -76,12 +76,13 @@ set_symlinks() { set_man_symlink "${target}" "view" # it's not okay if these fail - ln -s "${dir}/${target}" "${ROOT}/usr/bin/vi" || \ - die "Couldn't set ${target} /usr/bin/vi symlink" - ln -s "${dir}/${target}" "${ROOT}/usr/bin/ex" || \ - die "Couldn't set ${target} /usr/bin/ex symlink" - ln -s "${dir}/${target}" "${ROOT}/usr/bin/view" || \ - die "Couldn't set ${target} /usr/bin/view symlink" + target=$(relative_name "${dir}/${target}" "${ROOT}/usr/bin") + ln -s "${target}" "${ROOT}/usr/bin/vi" \ + || die "Couldn't set ${target} /usr/bin/vi symlink" + ln -s "${target}" "${ROOT}/usr/bin/ex" \ + || die "Couldn't set ${target} /usr/bin/ex symlink" + ln -s "${target}" "${ROOT}/usr/bin/view" \ + || die "Couldn't set ${target} /usr/bin/view symlink" else die -q "Target \"${1}\" doesn't appear to be valid!" fi |