Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 214817 | Differences between
and this patch

Collapse All | Expand All

(-)sh.eselect.orig (-7 / +5 lines)
Lines 9-24 VERSION=$(svn_date_to_version "${SVN_DAT Link Here
9
9
10
## Functions ##
10
## Functions ##
11
11
12
# find a list of vi symlink targets, best first
12
# find a list of sh symlink targets, best first
13
find_targets() {
13
find_targets() {
14
	local f
14
	local f
15
	for f in \
15
	for f in \
16
			"${ROOT}"/bin/bash \
16
			"${ROOT}"/bin/bash \
17
			"${ROOT}"/bin/busybox \
18
			"${ROOT}"/bin/dash \
17
			"${ROOT}"/bin/dash \
19
			"${ROOT}"/bin/zsh \
18
			"${ROOT}"/bin/zsh \
20
		; do
19
		; do
21
		if [[ -f "${f}" ]] ; then
20
		if [[ -x "${f}" ]] ; then
22
			echo $(basename "${f}" )
21
			echo $(basename "${f}" )
23
		fi
22
		fi
24
	done
23
	done
Lines 45-54 set_symlinks() { Link Here
45
	#	dir="${ROOT}/usr/bin"
44
	#	dir="${ROOT}/usr/bin"
46
	#fi
45
	#fi
47
46
48
	if [[ -f "${ROOT}/bin/${target}" ]] ; then
47
	if [[ -x "${ROOT}/bin/${target}" ]] ; then
49
		remove_symlinks
48
		remove_symlinks
50
49
51
		ln -s "${ROOT}/bin/${target}" "${ROOT}/bin/sh" || \
50
		ln -s "${target}" "${ROOT}/bin/sh" || \
52
			die "Couldn't set ${target} /bin/sh symlink"
51
			die "Couldn't set ${target} /bin/sh symlink"
53
	else
52
	else
54
		die -q  "Target \"${1}\" doesn't appear to be valid!"
53
		die -q  "Target \"${1}\" doesn't appear to be valid!"
Lines 118-124 do_set() { Link Here
118
	elif [[ -n "${2}" ]] ; then
117
	elif [[ -n "${2}" ]] ; then
119
		die -q "Too many parameters"
118
		die -q "Too many parameters"
120
119
121
	elif [[ -L "${ROOT}/usr/bin/vi" ]] ; then
120
	elif [[ -L "${ROOT}/bin/sh" ]] ; then
122
		if ! remove_symlinks ; then
121
		if ! remove_symlinks ; then
123
			die -q "Can't remove existing provider"
122
			die -q "Can't remove existing provider"
124
		elif ! set_symlinks "${1}" ; then
123
		elif ! set_symlinks "${1}" ; then
Lines 159-162 do_update() { Link Here
159
}
158
}
160
159
161
# vim: set ft=eselect :
160
# vim: set ft=eselect :
162

Return to bug 214817