simplify STAGE checks - use In_List

Closes: #952917
This commit is contained in:
jnqnfe 2015-01-06 03:43:43 +00:00 committed by Lyndon Brown
parent 62b3efa686
commit ed2d70bde1
3 changed files with 101 additions and 109 deletions

View File

@ -61,9 +61,7 @@ esac
# Creating directory
mkdir -p binary/${INITFS}
for STAGE in ${LB_CACHE_STAGES}
do
if [ "${STAGE}" = "rootfs" ] && [ -d cache/binary_rootfs ]
if In_list "rootfs" ${LB_CACHE_STAGES} && [ -d cache/binary_rootfs ]
then
# Removing old chroot
rm -rf binary/"${INITFS}"/filesystem.*
@ -76,7 +74,6 @@ do
Create_stagefile .build/binary_rootfs
exit 0
fi
done
case "${LB_CHROOT_FILESYSTEM}" in
ext2|ext3|ext4)
@ -443,9 +440,7 @@ case "${LB_CHROOT_FILESYSTEM}" in
esac
for STAGE in ${LB_CACHE_STAGES}
do
if [ "${STAGE}" = "rootfs" ]
if In_list "rootfs" ${LB_CACHE_STAGES}
then
rm -rf cache/binary_rootfs
@ -456,7 +451,6 @@ do
cp -a binary/"${INITFS}"/filesystem.* cache/binary_rootfs
fi
fi
done
# Creating stage file
Create_stagefile .build/binary_rootfs

View File

@ -27,10 +27,11 @@ Set_defaults
# Check architecture
Check_crossarchitectures
for STAGE in ${LB_CACHE_STAGES}
do
if [ "${STAGE}" = "bootstrap" ]
if ! In_list "bootstrap" ${LB_CACHE_STAGES}
then
exit 0
fi
case "${1}" in
restore)
# Checking stage file
@ -82,5 +83,3 @@ do
Create_stagefile .build/bootstrap_cache.save
;;
esac
fi
done

View File

@ -24,10 +24,11 @@ Arguments "${@}"
Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
Set_defaults
for STAGE in ${LB_CACHE_STAGES}
do
if [ "${STAGE}" = "chroot" ]
if ! In_list "chroot" ${LB_CACHE_STAGES}
then
exit 0
fi
case "${1}" in
restore)
Echo_message "Restoring chroot stage from cache..."
@ -78,5 +79,3 @@ do
Create_stagefile .build/chroot_cache.save
;;
esac
fi
done