From ed2d70bde10e8ff02e7409c125a6c70da8d6d9ba Mon Sep 17 00:00:00 2001 From: jnqnfe Date: Tue, 6 Jan 2015 03:43:43 +0000 Subject: simplify STAGE checks - use In_List Closes: #952917 --- scripts/build/binary_rootfs | 44 +++++++++++++++++++------------------------- 1 file changed, 19 insertions(+), 25 deletions(-) (limited to 'scripts/build/binary_rootfs') diff --git a/scripts/build/binary_rootfs b/scripts/build/binary_rootfs index 77f466c07..716615860 100755 --- a/scripts/build/binary_rootfs +++ b/scripts/build/binary_rootfs @@ -61,22 +61,19 @@ esac # Creating directory mkdir -p binary/${INITFS} -for STAGE in ${LB_CACHE_STAGES} -do - if [ "${STAGE}" = "rootfs" ] && [ -d cache/binary_rootfs ] - then - # Removing old chroot - rm -rf binary/"${INITFS}"/filesystem.* +if In_list "rootfs" ${LB_CACHE_STAGES} && [ -d cache/binary_rootfs ] +then + # Removing old chroot + rm -rf binary/"${INITFS}"/filesystem.* - # Restoring old cache - mkdir -p binary/"${INITFS}" - cp -a cache/binary_rootfs/filesystem.* binary/"${INITFS}" + # Restoring old cache + mkdir -p binary/"${INITFS}" + cp -a cache/binary_rootfs/filesystem.* binary/"${INITFS}" - # Creating stage file - Create_stagefile .build/binary_rootfs - exit 0 - fi -done + # Creating stage file + Create_stagefile .build/binary_rootfs + exit 0 +fi case "${LB_CHROOT_FILESYSTEM}" in ext2|ext3|ext4) @@ -443,20 +440,17 @@ case "${LB_CHROOT_FILESYSTEM}" in esac -for STAGE in ${LB_CACHE_STAGES} -do - if [ "${STAGE}" = "rootfs" ] - then - rm -rf cache/binary_rootfs +if In_list "rootfs" ${LB_CACHE_STAGES} +then + rm -rf cache/binary_rootfs - mkdir -p cache/binary_rootfs + mkdir -p cache/binary_rootfs - if [ "${LB_CHROOT_FILESYSTEM}" != "none" ] - then - cp -a binary/"${INITFS}"/filesystem.* cache/binary_rootfs - fi + if [ "${LB_CHROOT_FILESYSTEM}" != "none" ] + then + cp -a binary/"${INITFS}"/filesystem.* cache/binary_rootfs fi -done +fi # Creating stage file Create_stagefile .build/binary_rootfs -- cgit v1.2.3