[oe-commits] Tom Rini : ifupdown: Add update-alternatives

git version control git at git.openembedded.org
Fri Nov 12 03:15:57 UTC 2010


Module: openembedded.git
Branch: org.openembedded.dev
Commit: 8e9b64410d45ad9c04658a49f876116cdf1994e0
URL:    http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=8e9b64410d45ad9c04658a49f876116cdf1994e0

Author: Tom Rini <tom_rini at mentor.com>
Date:   Thu Nov 11 20:07:40 2010 -0700

ifupdown: Add update-alternatives

Signed-off-by: Tom Rini <tom_rini at mentor.com>

---

 recipes/ifupdown/ifupdown-ubuntu_0.6.8.bb |   16 ++++++++++++++--
 recipes/ifupdown/ifupdown_0.6.10.bb       |   14 +++++++++++++-
 2 files changed, 27 insertions(+), 3 deletions(-)

diff --git a/recipes/ifupdown/ifupdown-ubuntu_0.6.8.bb b/recipes/ifupdown/ifupdown-ubuntu_0.6.8.bb
index 3c8de81..3cccdb2 100644
--- a/recipes/ifupdown/ifupdown-ubuntu_0.6.8.bb
+++ b/recipes/ifupdown/ifupdown-ubuntu_0.6.8.bb
@@ -8,7 +8,7 @@ SECTION = "base"
 
 PROVIDES = "ifupdown"
 
-PR = "r2"
+PR = "r3"
 
 inherit update-rc.d
 
@@ -39,7 +39,19 @@ do_install () {
 	install -m 0644 ifup.8 ${D}${mandir}/man8
 	install -m 0644 interfaces.5 ${D}${mandir}/man5
 	cd ${D}${mandir}/man8 && ln -s ifup.8 ifdown.8
+	mv ${D}${base_sbindir}/ifup ${D}${base_sbindir}/ifup.${PN}
+	mv ${D}${base_sbindir}/ifdown ${D}${base_sbindir}/ifdown.${PN}
 }
+
+pkg_postinst_${PN} () {
+	update-alternatives --install ${base_sbindir}/ifup ifup ifup.${PN} 100
+	update-alternatives --install ${base_sbindir}/ifdown ifdown ifdown.${PN} 100
+}
+
+pkg_prerm_${PN} () {
+	update-alternatives --remove ifup ifup.${PN}
+	update-alternatives --remove ifdown ifdown.${PN}
+}
+
 INITSCRIPT_NAME = "ifup"
 INITSCRIPT_PARAMS = "start 39 S . stop 39 0 6 1 ."
-
diff --git a/recipes/ifupdown/ifupdown_0.6.10.bb b/recipes/ifupdown/ifupdown_0.6.10.bb
index 31e24d5..04d6870 100644
--- a/recipes/ifupdown/ifupdown_0.6.10.bb
+++ b/recipes/ifupdown/ifupdown_0.6.10.bb
@@ -4,7 +4,7 @@ configure (or, respectively, deconfigure) network interfaces, based on \
 the file /etc/network/interfaces."
 LICENSE = "GPL"
 SECTION = "base"
-PR = "r2"
+PR = "r3"
 
 
 SRC_URI = "${DEBIAN_MIRROR}/main/i/ifupdown/ifupdown_${PV}.tar.gz;name=ifupdown \
@@ -33,6 +33,18 @@ do_install () {
 	install -m 0644 ifup.8 ${D}${mandir}/man8
 	install -m 0644 interfaces.5 ${D}${mandir}/man5
 	cd ${D}${mandir}/man8 && ln -s ifup.8 ifdown.8
+	mv ${D}${base_sbindir}/ifup ${D}${base_sbindir}/ifup.${PN}
+	mv ${D}${base_sbindir}/ifdown ${D}${base_sbindir}/ifdown.${PN}
+}
+
+pkg_postinst_${PN} () {
+	update-alternatives --install ${base_sbindir}/ifup ifup ifup.${PN} 100
+	update-alternatives --install ${base_sbindir}/ifdown ifdown ifdown.${PN} 100
+}
+
+pkg_prerm_${PN} () {
+	update-alternatives --remove ifup ifup.${PN}
+	update-alternatives --remove ifdown ifdown.${PN}
 }
 
 INITSCRIPT_NAME = "ifup"





More information about the Openembedded-commits mailing list