Yocto Project Discussions
 help / color / mirror / Atom feed
* [opkg-utils PATCH] update-alternatives: correctly match priority
@ 2020-10-24 20:24 Alexander Kanavin
  0 siblings, 0 replies; only message in thread
From: Alexander Kanavin @ 2020-10-24 20:24 UTC (permalink / raw)
  To: opkg-devel, yocto; +Cc: Alexander Kanavin

It should always be at the end of string, otherwise something
like "/usr/bin/python3.9-config 123" will erroneously match
against priority 9.

Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
---
 update-alternatives | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/update-alternatives b/update-alternatives
index 1389b3f..e0b31bf 100644
--- a/update-alternatives
+++ b/update-alternatives
@@ -94,7 +94,7 @@ add_alt() {
 	local path="$2"
 	local priority="$3"
 	remove_alt $name $path
-	if grep -qw "$priority" $ad/$name; then
+	if grep -qw "$priority"$ $ad/$name; then
 		echo "Warn: update-alternatives: $name has multiple providers with the same priority, please check $ad/$name for details"
 	fi
 	echo "$path $priority" >> $ad/$name
-- 
2.28.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-10-24 20:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-24 20:24 [opkg-utils PATCH] update-alternatives: correctly match priority Alexander Kanavin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox