Patchwork [1/1] rootfs_rpm.bbclass: maybe no rpm postinst script

login
register
mail settings
Submitter Robert Yang
Date Sept. 26, 2012, 9:22 a.m.
Message ID <03f41d916fc8d7813612d4d750ecc89c7d4a8382.1348645880.git.liezhi.yang@windriver.com>
Download mbox | patch
Permalink /patch/37251/
State Accepted
Commit 553d9dbe0e426a4f933bef291cabfea7ae80f51a
Headers show

Comments

Robert Yang - Sept. 26, 2012, 9:22 a.m.
There maybe no rpm postinst script (e.g., core-image-minimal), then the
"*" is not expanded, and there would be error:

head: cannot open `rpm-postinsts/*' for reading: No such file or directory

Check whether it exists or not will fix the problem.

[YOCTO #3172]

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
 meta/classes/rootfs_rpm.bbclass | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Patch

diff --git a/meta/classes/rootfs_rpm.bbclass b/meta/classes/rootfs_rpm.bbclass
index d95ccfa..c86cd09 100644
--- a/meta/classes/rootfs_rpm.bbclass
+++ b/meta/classes/rootfs_rpm.bbclass
@@ -81,7 +81,9 @@  fakeroot rootfs_rpm_do_rootfs () {
 
 	# Report delayed package scriptlets
 	for i in ${IMAGE_ROOTFS}/etc/rpm-postinsts/*; do
-		echo "Delayed package scriptlet: `head -n 3 $i | tail -n 1`"
+		if [ -f $i ]; then
+			echo "Delayed package scriptlet: `head -n 3 $i | tail -n 1`"
+		fi
 	done
 
 	install -d ${IMAGE_ROOTFS}/${sysconfdir}/rcS.d