Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Sinan Kaya <okaya@kernel.org>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH v1] postinst-intercepts: check tool presence in intercept hooks
Date: Tue, 25 Jun 2019 22:13:19 +0000	[thread overview]
Message-ID: <20190625221319.102643-1-okaya@kernel.org> (raw)

do_rootfs: The postinstall intercept hook 'update_udev_hwdb'
do_rootfs: The postinstall intercept hook 'update_gio_module_cache' failed
do_rootfs: The postinstall intercept hook 'update_icon_cache' failed
do_rootfs: The postinstall intercept hook 'update_icon_cache' failed

Signed-off-by: Sinan Kaya <okaya@kernel.org>
---
 scripts/postinst-intercepts/update_font_cache    |  6 ++++--
 .../postinst-intercepts/update_gio_module_cache  | 10 +++++++---
 scripts/postinst-intercepts/update_icon_cache    | 16 +++++++++-------
 scripts/postinst-intercepts/update_pixbuf_cache  |  5 ++++-
 scripts/postinst-intercepts/update_udev_hwdb     |  6 ++++--
 5 files changed, 28 insertions(+), 15 deletions(-)

diff --git a/scripts/postinst-intercepts/update_font_cache b/scripts/postinst-intercepts/update_font_cache
index 3053c7065f4..954acbb41b2 100644
--- a/scripts/postinst-intercepts/update_font_cache
+++ b/scripts/postinst-intercepts/update_font_cache
@@ -5,5 +5,7 @@
 
 set -e
 
-PSEUDO_UNLOAD=1 ${binprefix}qemuwrapper -L $D -E ${fontconfigcacheenv} $D${libexecdir}/${binprefix}fc-cache --sysroot=$D --system-only ${fontconfigcacheparams}
-chown -R root:root $D${fontconfigcachedir}
+if [ -f $D${libexecdir}/${binprefix}fc-cache ]; then
+	PSEUDO_UNLOAD=1 ${binprefix}qemuwrapper -L $D -E ${fontconfigcacheenv} $D${libexecdir}/${binprefix}fc-cache --sysroot=$D --system-only ${fontconfigcacheparams}
+	chown -R root:root $D${fontconfigcachedir}
+fi
diff --git a/scripts/postinst-intercepts/update_gio_module_cache b/scripts/postinst-intercepts/update_gio_module_cache
index c87fa85db9e..e8483cb0bf5 100644
--- a/scripts/postinst-intercepts/update_gio_module_cache
+++ b/scripts/postinst-intercepts/update_gio_module_cache
@@ -5,7 +5,11 @@
 
 set -e
 
-PSEUDO_UNLOAD=1 ${binprefix}qemuwrapper -L $D $D${libexecdir}/${binprefix}gio-querymodules $D${libdir}/gio/modules/
+if [ -f $D${libexecdir}/${binprefix}gio-querymodules ]; then
+
+	PSEUDO_UNLOAD=1 ${binprefix}qemuwrapper -L $D $D${libexecdir}/${binprefix}gio-querymodules $D${libdir}/gio/modules/
+
+	[ ! -e $D${libdir}/gio/modules/giomodule.cache ] ||
+		chown root:root $D${libdir}/gio/modules/giomodule.cache
+fi
 
-[ ! -e $D${libdir}/gio/modules/giomodule.cache ] ||
-	chown root:root $D${libdir}/gio/modules/giomodule.cache
diff --git a/scripts/postinst-intercepts/update_icon_cache b/scripts/postinst-intercepts/update_icon_cache
index 212209a9daf..a67ff7ef970 100644
--- a/scripts/postinst-intercepts/update_icon_cache
+++ b/scripts/postinst-intercepts/update_icon_cache
@@ -5,12 +5,14 @@
 
 set -e
 
-# update native pixbuf loaders
-$STAGING_DIR_NATIVE/${libdir_native}/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders --update-cache
+if [ -d $STAGING_DIR_NATIVE/${libdir_native}/gdk-pixbuf-2.0 ]; then
+	# update native pixbuf loaders
+	$STAGING_DIR_NATIVE/${libdir_native}/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders --update-cache
 
-for icondir in $D/usr/share/icons/*/ ; do
-    if [ -d $icondir ] ; then
-        gtk-update-icon-cache -fqt  $icondir
-    fi
-done
+	for icondir in $D/usr/share/icons/*/ ; do
+	    if [ -d $icondir ] ; then
+	        gtk-update-icon-cache -fqt  $icondir
+	    fi
+	done
+fi
 
diff --git a/scripts/postinst-intercepts/update_pixbuf_cache b/scripts/postinst-intercepts/update_pixbuf_cache
index ea12814474e..166422e5c37 100644
--- a/scripts/postinst-intercepts/update_pixbuf_cache
+++ b/scripts/postinst-intercepts/update_pixbuf_cache
@@ -8,6 +8,9 @@ set -e
 export GDK_PIXBUF_MODULEDIR=$D${libdir}/gdk-pixbuf-2.0/2.10.0/loaders
 export GDK_PIXBUF_FATAL_LOADER=1
 
-PSEUDO_UNLOAD=1 ${binprefix}qemuwrapper -L $D $D${libdir}/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders \
+if [ -d $D${libdir}/gdk-pixbuf-2.0 ]; then
+	PSEUDO_UNLOAD=1 ${binprefix}qemuwrapper -L $D $D${libdir}/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders \
     >$GDK_PIXBUF_MODULEDIR/../loaders.cache && \
     sed -i -e "s:$D::g" $GDK_PIXBUF_MODULEDIR/../loaders.cache
+fi
+
diff --git a/scripts/postinst-intercepts/update_udev_hwdb b/scripts/postinst-intercepts/update_udev_hwdb
index c4fb2bffcbf..7b6e38338f3 100644
--- a/scripts/postinst-intercepts/update_udev_hwdb
+++ b/scripts/postinst-intercepts/update_udev_hwdb
@@ -5,5 +5,7 @@
 
 set -e
 
-PSEUDO_UNLOAD=1 ${binprefix}qemuwrapper -L $D $D${libexecdir}/${binprefix}udevadm hwdb --update --root $D
-chown root:root $D${sysconfdir}/udev/hwdb.bin
+if [ -d $D/lib/udev/hwdb.d ]; then
+	PSEUDO_UNLOAD=1 ${binprefix}qemuwrapper -L $D $D${libexecdir}/${binprefix}udevadm hwdb --update --root $D
+	chown root:root $D${sysconfdir}/udev/hwdb.bin
+fi
-- 
2.21.0



             reply	other threads:[~2019-06-25 22:13 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-25 22:13 Sinan Kaya [this message]
2019-06-26  2:27 ` [PATCH v1] postinst-intercepts: check tool presence in intercept hooks ChenQi
2019-06-26  8:59   ` Alexander Kanavin
2019-06-26 17:33     ` Sinan Kaya
2019-06-26 18:10       ` Alexander Kanavin
2019-06-26 21:21       ` Richard Purdie
2019-06-26 22:57         ` Sinan Kaya
2019-06-27  8:46           ` Alexander Kanavin
2019-06-30 16:56             ` Sinan Kaya
2019-06-30 21:54               ` richard.purdie
2019-07-01  1:38                 ` Sinan Kaya
2019-06-27  8:57           ` richard.purdie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190625221319.102643-1-okaya@kernel.org \
    --to=okaya@kernel.org \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox