diff options
author | jnqnfe <jnqnfe@gmail.com> | 2015-01-06 03:43:43 +0000 |
---|---|---|
committer | Lyndon Brown <jnqnfe@gmail.com> | 2020-03-10 00:02:43 +0000 |
commit | ed2d70bde10e8ff02e7409c125a6c70da8d6d9ba (patch) | |
tree | 8253affd17e14ce6f3944ce498a92acaf31542a9 /scripts/build/binary_rootfs | |
parent | 62b3efa6869a79b0f134203f87fbc9234b0d9d4d (diff) | |
download | vyos-live-build-ed2d70bde10e8ff02e7409c125a6c70da8d6d9ba.tar.gz vyos-live-build-ed2d70bde10e8ff02e7409c125a6c70da8d6d9ba.zip |
simplify STAGE checks - use In_List
Closes: #952917
Diffstat (limited to 'scripts/build/binary_rootfs')
-rwxr-xr-x | scripts/build/binary_rootfs | 44 |
1 files changed, 19 insertions, 25 deletions
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 |