From 82baab5bd5e5ec4369eaad393feeee3132f0c087 Mon Sep 17 00:00:00 2001 From: Alexander Kanavin Date: Wed, 28 Oct 2020 22:05:56 +0100 Subject: opkg-utils: correct priority matching in update-alternatives Signed-off-by: Alexander Kanavin Signed-off-by: Richard Purdie --- ...ate-alternatives-correctly-match-priority.patch | 28 ++++++++++++++++++++++ .../opkg-utils/opkg-utils_0.4.3.bb | 5 ++-- 2 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 meta/recipes-devtools/opkg-utils/opkg-utils/0001-update-alternatives-correctly-match-priority.patch diff --git a/meta/recipes-devtools/opkg-utils/opkg-utils/0001-update-alternatives-correctly-match-priority.patch b/meta/recipes-devtools/opkg-utils/opkg-utils/0001-update-alternatives-correctly-match-priority.patch new file mode 100644 index 0000000000..556d4ce5f5 --- /dev/null +++ b/meta/recipes-devtools/opkg-utils/opkg-utils/0001-update-alternatives-correctly-match-priority.patch @@ -0,0 +1,28 @@ +From 26206005dacd61380663bb4fd9b18178bb33665b Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin +Date: Sat, 24 Oct 2020 21:59:27 +0200 +Subject: [PATCH] update-alternatives: correctly match priority + +It should always be at the end of string, otherwise something +like "/usr/bin/python3.9-config 123" will erroneously match +against priority 9. + +Upstream-Status: Submitted +Signed-off-by: Alexander Kanavin +--- + 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 diff --git a/meta/recipes-devtools/opkg-utils/opkg-utils_0.4.3.bb b/meta/recipes-devtools/opkg-utils/opkg-utils_0.4.3.bb index f9df58a295..ce299d6b63 100644 --- a/meta/recipes-devtools/opkg-utils/opkg-utils_0.4.3.bb +++ b/meta/recipes-devtools/opkg-utils/opkg-utils_0.4.3.bb @@ -7,8 +7,9 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \ file://opkg.py;beginline=2;endline=18;md5=ffa11ff3c15eb31c6a7ceaa00cc9f986" PROVIDES += "${@bb.utils.contains('PACKAGECONFIG', 'update-alternatives', 'virtual/update-alternatives', '', d)}" -SRC_URI = "http://git.yoctoproject.org/cgit/cgit.cgi/${BPN}/snapshot/${BPN}-${PV}.tar.gz \ -" +SRC_URI = "http://git.yoctoproject.org/cgit/cgit.cgi/${BPN}/snapshot/${BPN}-${PV}.tar.gz \ + file://0001-update-alternatives-correctly-match-priority.patch \ + " UPSTREAM_CHECK_URI = "http://git.yoctoproject.org/cgit/cgit.cgi/opkg-utils/refs/" SRC_URI[md5sum] = "7bbadb3c381f3ea935b21d3bb8cc4671" -- cgit 1.2.3-korg