Permalink
Browse files

time: Make /usr/bin/time use update-alternatives

This is a little funny as we don't want u-a on the -native.

Signed-off-by: Tom Rini <tom_rini@mentor.com>
  • Loading branch information...
1 parent f57b099 commit f5d1842937314b643671ffc9215194d40699741d Tom Rini committed Sep 10, 2010
Showing with 16 additions and 1 deletion.
  1. +16 −1 recipes/time/time.inc
View
@@ -1,6 +1,21 @@
DESCRIPTION = "time measures many of the CPU resources, such as time and \
memory, that other programs use."
HOMEPAGE = "http://www.gnu.org/software/time/"
-LICENSE = "GPL"
SECTION = "utils"
+LICENSE = "GPL"
+PR = "r1"
+
+# We only want rename for update-alternatives on the target
+do_install_append_pn-time () {
+ mv ${D}${bindir}/time ${D}${bindir}/time.${PN}
+}
+
+pkg_prerm_${PN} () {
+ update-alternatives --remove time time.${PN}
+}
+
+pkg_postinst_${PN} () {
+ update-alternatives --install ${bindir}/time time time.${PN} 100
+}
+
BBCLASSEXTEND = "native"

0 comments on commit f5d1842

Please sign in to comment.