]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
opkg-utils: fix double slash problem in update-alternatives ChenQi/update-alternatives-double-slash
authorChen Qi <Qi.Chen@windriver.com>
Fri, 21 Nov 2014 08:44:24 +0000 (03:44 -0500)
committerChen Qi <Qi.Chen@windriver.com>
Fri, 21 Nov 2014 08:47:18 +0000 (16:47 +0800)
When using update-alternatives, we would get output like the following:
update-alternatives: Linking //usr/bin/sh to /usr/bin/bash

What we really want is:
update-alternatives: Linking /usr/bin/sh to /usr/bin/bash

This patch fixes the above problem.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
meta/recipes-devtools/opkg-utils/opkg-utils/0001-update-alternatives-avoid-double-slashes.patch [new file with mode: 0644]
meta/recipes-devtools/opkg-utils/opkg-utils_git.bb

diff --git a/meta/recipes-devtools/opkg-utils/opkg-utils/0001-update-alternatives-avoid-double-slashes.patch b/meta/recipes-devtools/opkg-utils/opkg-utils/0001-update-alternatives-avoid-double-slashes.patch
new file mode 100644 (file)
index 0000000..a63b26b
--- /dev/null
@@ -0,0 +1,25 @@
+Upstream-Status: Pending
+
+Subject: update-alternatives: avoid double slashes
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ update-alternatives |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/update-alternatives b/update-alternatives
+index 8916cbd..ca01d5d 100644
+--- a/update-alternatives
++++ b/update-alternatives
+@@ -97,7 +97,7 @@ find_best_alt() {
+       [ $# -lt 1 ] && return 1
+       [ ! -f $ad/$name ] && return 0
+-      link=$OPKG_OFFLINE_ROOT/`head -n 1 $ad/$name`
++      link=$OPKG_OFFLINE_ROOT`head -n 1 $ad/$name`
+       prio=`sed -ne "1!p" $ad/$name | sed -e "s/\(.*\) \(.*\)/\2 \1/g" | sort -nr | head -n 1 | sed 's/ [^ ]*$//'`
+       if [ -z "$prio" ]; then
+-- 
+1.7.9.5
+
index 72dc98e2fcf75a7d46195c01fdcb863cd482ba9f..1c9a3b5c97769596580491ef693d8128888c40e3 100644 (file)
@@ -10,7 +10,8 @@ PROVIDES += "virtual/update-alternatives"
 SRCREV = "762d9dadce548108d4204c2113461a7dd6f57e60"
 PV = "0.1.8+git${SRCPV}"
 
-SRC_URI = "git://git.yoctoproject.org/opkg-utils"
+SRC_URI = "git://git.yoctoproject.org/opkg-utils \
+           file://0001-update-alternatives-avoid-double-slashes.patch"
 
 S = "${WORKDIR}/git"