Skip to content
This repository has been archived by the owner on May 8, 2024. It is now read-only.

Commit

Permalink
Merge pull request #662 from wjz304/patch-3
Browse files Browse the repository at this point in the history
Adjust the logic for clearing the cache.
  • Loading branch information
fbelavenuto authored May 2, 2023
2 parents 3322466 + edce7eb commit 194de75
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions files/board/arpl/overlayfs/opt/arpl/menu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -503,13 +503,6 @@ function extractDsmFiles() {
RAMDISK_HASH="`readModelKey "${MODEL}" "builds.${BUILD}.pat.ramdisk-hash"`"
ZIMAGE_HASH="`readModelKey "${MODEL}" "builds.${BUILD}.pat.zimage-hash"`"

# If we have little disk space, clean cache folder
if [ ${CLEARCACHE} -eq 1 ]; then
echo "Cleaning cache"
rm -rf "${CACHE_PATH}/dl"
fi
mkdir -p "${CACHE_PATH}/dl"

SPACELEFT=`df --block-size=1 | awk '/'${LOADER_DEVICE_NAME}'3/{print$4}'` # Check disk space left

PAT_FILE="${MODEL}-${BUILD}.pat"
Expand All @@ -521,6 +514,13 @@ function extractDsmFiles() {
if [ -f "${PAT_PATH}" ]; then
echo "${PAT_FILE} cached."
else
# If we have little disk space, clean cache folder
if [ ${CLEARCACHE} -eq 1 ]; then
echo "Cleaning cache"
rm -rf "${CACHE_PATH}/dl"
fi
mkdir -p "${CACHE_PATH}/dl"

echo "Downloading ${PAT_FILE}"
# Discover remote file size
FILESIZE=`curl --insecure -sLI "${PAT_URL}" | grep -i Content-Length | awk '{print$2}'`
Expand Down

0 comments on commit 194de75

Please sign in to comment.