update-alternatives: fix the sed pattern in remove_alt
PATCH 1/1 update-alternatives: fix the sed pattern in remove_alt
From: Jackie Huang <[email protected]>
'\>' 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.
--- update-alternatives | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
update-alternatives +1 -1
@@ -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 }
Signature · 1 line
2.7.4
merged
________________________________________
From: [email protected] <[email protected]> on behalf of [email protected] <[email protected]>
Sent: Thursday, January 18, 2018 8:59 PM
To: [email protected]; [email protected]
Subject: [opkg-devel] [opkg-utils PATCH] update-alternatives: fix the sed pattern in remove_alt
From: Jackie Huang <[email protected]>
'\>' 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.
--- update-alternatives | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
update-alternatives +1 -1
@@ -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 }
--
2.7.4
--
You received this message because you are subscribed to the Google Groups "opkg-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://urldefense.proofpoint.com/v2/url?u=https-3A__groups.google.com_d_optout&d=DwIBaQ&c=I_0YwoKy7z5LMTVdyO6YCiE2uzI1jjZZuIPelcSjixA&r=wNcrL2akRn6jfxhHaKavUrJB_C9JAMXtynjLd8ZzgXQ&m=yP6B3nYh5DMMS7JjJioLfn3jVyH-4GTPElZp4VeNx-Q&s=zO7LsP7fVT0yerk7aCY5q3_lclpvVYcHsT8gWG3B29g&e=.