Patchwork [RFC,3/3] opkg: Don't use update-alternatives

login
register
mail settings
Submitter Paul Barker
Date Nov. 20, 2013, 4:41 p.m.
Message ID <1384965670-23435-4-git-send-email-paul@paulbarker.me.uk>
Download mbox | patch
Permalink /patch/62041/
State New
Headers show

Comments

Paul Barker - Nov. 20, 2013, 4:41 p.m.
The symlink from 'opkg' to 'opkg-cl' doesn't need to be created with
update-alternatives as there isn't any alternative. Instead it can be created by
hand in do_install_append.

Signed-off-by: Paul Barker <paul@paulbarker.me.uk>
---
 meta/recipes-devtools/opkg/opkg.inc | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

Patch

diff --git a/meta/recipes-devtools/opkg/opkg.inc b/meta/recipes-devtools/opkg/opkg.inc
index d16b8c2..f476e67 100644
--- a/meta/recipes-devtools/opkg/opkg.inc
+++ b/meta/recipes-devtools/opkg/opkg.inc
@@ -69,6 +69,10 @@  do_install_append() {
 			-e 's,@SYSTEMD_UNITDIR@,${systemd_unitdir},g' \
 			${D}${systemd_unitdir}/system/opkg-configure.service
 	fi
+
+	# The installed binary is 'opkg-cl' but people and scripts often expect
+	# it to just be 'opkg'
+	ln -sf opkg-cl ${D}${bindir}/opkg
 }
 
 do_install_append_class-native() {
@@ -97,13 +101,6 @@  rm -f ${sysconfdir}/rcS.d/S${POSTINSTALL_INITPOSITION}run-postinsts
 fi
 }
 
-inherit update-alternatives
-
-ALTERNATIVE_PRIORITY = "100"
-ALTERNATIVE_${PN} = "opkg"
-ALTERNATIVE_LINK_NAME[opkg] = "${bindir}/opkg"
-ALTERNATIVE_TARGET[opkg] = "${bindir}/opkg-cl"
-
 BBCLASSEXTEND = "native nativesdk"
 
 # Define a variable to allow distros to run configure earlier.