stx-anaconda-image.bbclass: add error handling when copy pkgs 18/3718/1 bronze-rc0
authorJackie Huang <jackie.huang@windriver.com>
Fri, 15 May 2020 12:38:55 +0000 (20:38 +0800)
committerJackie Huang <jackie.huang@windriver.com>
Fri, 15 May 2020 15:37:46 +0000 (23:37 +0800)
Add error handling when copy pkgs avoid do_rootfs failure
if there is any changes in the pkglist.

Issue-ID: INF-118
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
Change-Id: I5242b02ffae096726732e9a3ed9d0cbefbcba945

meta-stx/classes/stx-anaconda-image.bbclass

index c89dc9f..bab06f2 100644 (file)
@@ -100,7 +100,12 @@ wrl_installer_copy_local_repos() {
 
         cd ${deploy_dir_rpm}
         for pkg in `cat ${REPO_INCLUDE_PKG}`; do
-            cp --parents -vf */${pkg}.rpm ${IMAGE_ROOTFS}/Packages.$prj_name/
+            pkg_file=$(find . -type f -name ${pkg}.rpm)
+            if [ -z "${pkg_file}" ]; then
+                bbwarn "Package ${pkg}.rpm not found, please check if there is anything wrong or just remove it from the list."
+            else
+                cp --parents -vf ${pkg_file} ${IMAGE_ROOTFS}/Packages.$prj_name/
+            fi
         done
         cd -