From: Jackie Huang Date: Fri, 15 May 2020 12:38:55 +0000 (+0800) Subject: stx-anaconda-image.bbclass: add error handling when copy pkgs X-Git-Tag: bronze-rc0^0 X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=650ec4de02685d860ee134eae3f595a2fe4b210b;p=pti%2Frtp.git stx-anaconda-image.bbclass: add error handling when copy pkgs 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 Change-Id: I5242b02ffae096726732e9a3ed9d0cbefbcba945 --- diff --git a/meta-stx/classes/stx-anaconda-image.bbclass b/meta-stx/classes/stx-anaconda-image.bbclass index c89dc9f..bab06f2 100644 --- a/meta-stx/classes/stx-anaconda-image.bbclass +++ b/meta-stx/classes/stx-anaconda-image.bbclass @@ -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 -