update-alternatives: fix the sed pattern in remove_alt

'\>' is to matches the end of a word, but the executable is
not always a 'word', e.g. /usr/lib64/busybox/usr/bin/[

then such alternatives can not be removed.

So change to use '\s' in the pattern since the following
character of the $path is whitespace.

Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
This commit is contained in:
Jackie Huang
2018-01-19 10:59:56 +08:00
committed by Alejandro del Castillo
parent 13f6281d24
commit f2e63deda2

View File

@@ -80,7 +80,7 @@ remove_alt() {
[ ! -f $ad/$name ] && return 0
path=`echo $path | protect_slashes | protect_special_character`
sed -ne "/^$path\>.*/!p" $ad/$name > $ad/$name.new
sed -ne "/^$path\s.*/!p" $ad/$name > $ad/$name.new
mv $ad/$name.new $ad/$name
}