Patchwork [CONSOLIDATED,REQUEST,34/64] net-tools: cleanup update-alternatives deprecated code

login
register
mail settings
Submitter Saul Wold
Date Aug. 14, 2012, 12:13 p.m.
Message ID <1667ef3181f6b7ac3df109da981507f5a9e0fec6.1344946189.git.sgw@linux.intel.com>
Download mbox | patch
Permalink /patch/34535/
State Accepted
Commit f8b25d33e154173e2ce022c88563c6be872ce4b4
Headers show

Comments

Saul Wold - Aug. 14, 2012, 12:13 p.m.
Signed-off-by: Saul Wold <sgw@linux.intel.com>
---
 .../net-tools/net-tools_1.60-23.bb                 |   19 ++++++++++++-------
 1 files changed, 12 insertions(+), 7 deletions(-)

Patch

diff --git a/meta/recipes-extended/net-tools/net-tools_1.60-23.bb b/meta/recipes-extended/net-tools/net-tools_1.60-23.bb
index 764955e..309363b 100644
--- a/meta/recipes-extended/net-tools/net-tools_1.60-23.bb
+++ b/meta/recipes-extended/net-tools/net-tools_1.60-23.bb
@@ -5,7 +5,7 @@  BUGTRACKER = "http://bugs.debian.org/net-tools"
 LICENSE = "GPLv2+"
 LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b \
                     file://ifconfig.c;startline=11;endline=15;md5=da4c7bb79a5d0798faa99ef869721f4a"
-PR = "r1"
+PR = "r2"
 
 SRC_URI = "${DEBIAN_MIRROR}/main/n/net-tools/net-tools_1.60.orig.tar.gz;name=tarball \
            ${DEBIAN_MIRROR}/main/n/net-tools/${BPN}_${PV}.diff.gz;apply=no;name=patch \
@@ -67,16 +67,21 @@  do_compile() {
 	oe_runmake
 }
 
+do_install() {
+	oe_runmake 'BASEDIR=${D}' install
+}
+
 inherit update-alternatives
 
 base_sbindir_progs = "arp ifconfig ipmaddr iptunnel mii-tool nameif plipconfig rarp route slattach"
-ALTERNATIVE_LINKS += "${base_sbindir}/${@' ${base_sbindir}/'.join((d.getVar('base_sbindir_progs', True)).split())}"
-
 base_bindir_progs  = "dnsdomainname domainname hostname netstat nisdomainname ypdomainname"
-ALTERNATIVE_LINKS += "${base_bindir}/${@' ${base_bindir}/'.join((d.getVar('base_bindir_progs', True)).split())}"
 
+ALTERNATIVE_${PN} = "${base_sbindir_progs} ${base_bindir_progs}"
+python __anonymous() {
+	for prog in d.getVar('base_sbindir_progs', True).split():
+		d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_sbindir', True), prog))
+	for prog in d.getVar('base_bindir_progs', True).split():
+		d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_bindir', True), prog))
+}
 ALTERNATIVE_PRIORITY = "100"
 
-do_install() {
-	oe_runmake 'BASEDIR=${D}' install
-}