Patchwork [05/11] fontcache.bbclass: use the postinst_intercept script

login
register
mail settings
Submitter Laurentiu Palcu
Date Feb. 12, 2013, 4:12 p.m.
Message ID <7f6d4f25222429b4cb3d69ded28e68c38aa22fc4.1360684306.git.laurentiu.palcu@intel.com>
Download mbox | patch
Permalink /patch/44521/
State Accepted
Commit b4c89bdae3778f2bf7596c1f3ca9fdaf7d480614
Headers show

Comments

Laurentiu Palcu - Feb. 12, 2013, 4:12 p.m.
"Link" the package to the postinstall hook by running the
postinst_intercept script.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
---
 meta/classes/fontcache.bbclass |   20 +++++++-------------
 1 file changed, 7 insertions(+), 13 deletions(-)

Patch

diff --git a/meta/classes/fontcache.bbclass b/meta/classes/fontcache.bbclass
index 8381735..d3c1562 100644
--- a/meta/classes/fontcache.bbclass
+++ b/meta/classes/fontcache.bbclass
@@ -8,21 +8,15 @@  inherit qemu
 
 FONT_PACKAGES ??= "${PN}"
 
+#
+# On host, the postinstall MUST return 1 because we do not know if the intercept
+# hook will succeed. If it does succeed, than the packages will be marked as
+# installed.
+#
 fontcache_common() {
 if [ "x$D" != "x" ] ; then
-	if [ ! -f $INTERCEPT_DIR/update_font_cache ]; then
-		cat << "EOF" > $INTERCEPT_DIR/update_font_cache
-#!/bin/sh
-
-${@qemu_run_binary(d, '$D', '/usr/bin/fc-cache')} --sysroot=$D >/dev/null 2>&1
-
-if [ $? -ne 0 ]; then
-    exit 1
-fi
-
-EOF
-	fi
-	exit 0
+	$INTERCEPT_DIR/postinst_intercept update_font_cache ${PKG} bindir=${bindir}
+	exit 1
 fi
 
 fc-cache