summaryrefslogtreecommitdiff
path: root/recipes/time/time.inc
diff options
context:
space:
mode:
authorTom Rini <tom_rini@mentor.com>2010-09-10 12:20:25 -0700
committerTom Rini <tom_rini@mentor.com>2010-09-13 09:00:45 -0700
commitf5d1842937314b643671ffc9215194d40699741d (patch)
tree5432748767ab280759759b969bbcc8eecd764028 /recipes/time/time.inc
parentf57b09944118b0f93ef9244f8a65765087c220a1 (diff)
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>
Diffstat (limited to 'recipes/time/time.inc')
-rw-r--r--recipes/time/time.inc17
1 files changed, 16 insertions, 1 deletions
diff --git a/recipes/time/time.inc b/recipes/time/time.inc
index 9f510da665..c5e37d4f38 100644
--- a/recipes/time/time.inc
+++ b/recipes/time/time.inc
@@ -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"