diff options
author | Anders Roxell <anders.roxell@linaro.org> | 2015-08-25 15:12:21 +0200 |
---|---|---|
committer | Anders Roxell <anders.roxell@linaro.org> | 2015-08-25 15:12:21 +0200 |
commit | 93d84b8039eb594b4ad058f75dfbfef93fe5a5db (patch) | |
tree | 602acc74243692c0f9ed31ea75f5dd137a3595da | |
parent | f8aeb4a349a4254cac2670b1a266ac5e2e191c4b (diff) |
post-build-create-image-manifest: copy package artifacts
Copy desired package(s) artifacts into ${WORKSPACE}/out
Change-Id: I994fc137779aa63ae94f1932c92fe193e34f2980
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
-rwxr-xr-x | post-build-create-image-manifest.sh | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/post-build-create-image-manifest.sh b/post-build-create-image-manifest.sh index 064167a..9831273 100755 --- a/post-build-create-image-manifest.sh +++ b/post-build-create-image-manifest.sh @@ -22,18 +22,22 @@ to prepare the 'output' folder OPTIONS: -h Show this message + -p String with packages, type -p all_packages to copy all -v Verbose output EOF } -while getopts “hv” OPTION +while getopts “hp:v” OPTION do case $OPTION in h) usage exit ;; + p) + package_list=${OPTARG} + ;; v) set -x ;; @@ -45,6 +49,7 @@ if [ -n "${WORKSPACE}" ]; then rm -rf ${WORKSPACE}/out/* oe_init_build_env=`find . -maxdepth 2 -type f -name oe-init-build-env` source ${oe_init_build_env} build + deploy_dir=`bitbake -e | grep "^DEPLOY_DIR="| cut -d'=' -f2 | tr -d '"'` deploy_dir_image=`bitbake -e | grep "^DEPLOY_DIR_IMAGE="| cut -d'=' -f2 | tr -d '"'` license_directory=`bitbake -e | grep "^LICENSE_DIRECTORY="| cut -d'=' -f2 | tr -d '"'` license_manifests=`find ${license_directory} -type f -name 'license.manifest'` @@ -63,4 +68,25 @@ if [ -n "${WORKSPACE}" ]; then cp -a $f ${WORKSPACE}/out fi done + + # copy packages that have been build + if [ "${package_list}" != "" ]; then + packaging="deb ipk rpm tar" + for pkg in $(echo ${packaging}) + do + if [ -d ${deploy_dir}/${pkg} ]; then + if [ "${package_list}" = "all_packages" ]; then + cp -r ${deploy_dir}/${pkg} ${WORKSPACE}/out + else + mkdir -p ${WORKSPACE}/out/${pkg} + for package in ${package_list} + do + tmp_dir=$(basename $(dirname $(ls $(find ${deploy_dir}/${pkg} -type f -name "*${package}*")|head -1))) + mkdir -p ${WORKSPACE}/out/${pkg}/${tmp_dir} + find ${deploy_dir}/${pkg} -type f -name "*${package}*" -exec cp {} ${WORKSPACE}/out/${pkg}/${tmp_dir} \; + done + fi + fi + done + fi fi |