[yocto] [opkg-utils PATCH] update-alternatives: fix the sed pattern in remove_alt

Huang, Jie (Jackie) Jackie.Huang at windriver.com
Thu Jan 18 19:04:15 PST 2018


Sorry I forgot adding opkg-devel, so I just re-sent with opkg-devel added in.

Thanks,
Jackie

> -----Original Message-----
> From: yocto-bounces at yoctoproject.org [mailto:yocto-
> bounces at yoctoproject.org] On Behalf Of jackie.huang at windriver.com
> Sent: Friday, January 19, 2018 10:54
> To: yocto at yoctoproject.org
> Subject: [yocto] [opkg-utils PATCH] update-alternatives: fix the sed pattern in
> remove_alt
> 
> From: Jackie Huang <jackie.huang at windriver.com>
> 
> '\>' 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 at windriver.com>
> ---
>  update-alternatives | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/update-alternatives b/update-alternatives
> index ffad853..ce7d66c 100644
> --- a/update-alternatives
> +++ b/update-alternatives
> @@ -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
> 
> --
> _______________________________________________
> yocto mailing list
> yocto at yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto



More information about the yocto mailing list