diff --git a/build-all.sh b/build-all.sh index 5c8997308..5b94f2502 100644 --- a/build-all.sh +++ b/build-all.sh @@ -32,7 +32,6 @@ mkdir -p /run/armbian RELEASE_LIST=("xenial" "jessie") BRANCH_LIST=("default" "next" "dev") - pack_upload () { # pack into .7z and upload to server @@ -66,7 +65,6 @@ while ! rsync -arP $CACHEDIR/$DESTIMG/. -e 'ssh -p 22' ${SEND_TO_SERVER}:/var/ww rm -r $CACHEDIR/$DESTIMG" & } - build_main () { touch "/run/armbian/Armbian_${BOARD^}_${BRANCH}_${RELEASE}_${BUILD_DESKTOP}.pid"; diff --git a/compile.sh b/compile.sh index 31c5c5298..600168fcb 100755 --- a/compile.sh +++ b/compile.sh @@ -15,10 +15,11 @@ KERNEL_ONLY="" # leave empty to select each time, set to "yes" or "no" to skip dialog prompt KERNEL_CONFIGURE="no" # change provided kernel configuration -CLEAN_LEVEL="make,debs" # comma-separated list of clean targets: "make" = make clean for selected kernel and u-boot, +CLEAN_LEVEL="make,debs,oldcache" # comma-separated list of clean targets: "make" = make clean for selected kernel and u-boot, # "debs" = delete packages in "./output/debs" for current branch and family, - # "alldebs" - delete all packages in "./output/debs", "images" = delete "./output/images", + # "alldebs" = delete all packages in "./output/debs", "images" = delete "./output/images", # "cache" = delete "./output/cache", "sources" = delete "./sources" + # "oldcache" = remove old cached rootfs except for the newest 6 files DEST_LANG="en_US.UTF-8" # sl_SI.UTF-8, en_US.UTF-8 diff --git a/general.sh b/general.sh index 46fb098f0..4178e18f2 100644 --- a/general.sh +++ b/general.sh @@ -59,7 +59,7 @@ cleaning() ;; cache) # delete output/cache - [[ -d $CACHEDIR ]] && display_alert "Cleaning" "output/cache" "info" && find $CACHEDIR/ -type f -delete + [[ -d $CACHEDIR ]] && display_alert "Cleaning" "output/cache/rootfs (all)" "info" && find $CACHEDIR/rootfs/ -type f -delete ;; images) # delete output/images @@ -69,6 +69,13 @@ cleaning() sources) # delete output/sources and output/buildpkg [[ -d $SOURCES ]] && display_alert "Cleaning" "sources" "info" && rm -rf $SOURCES/* $DEST/buildpkg/* ;; + + oldcache) + if [[ -d $CACHEDIR/rootfs/ && $(ls -1 $CACHEDIR/rootfs/ | wc -l) -gt 6 ]]; then + display_alert "Cleaning" "output/cache/rootfs (old)" "info" + (cd $CACHEDIR/rootfs/; ls -t | sed -e "1,6d" | xargs -d '\n' rm -f) + fi + ;; esac } diff --git a/main.sh b/main.sh index 09c0b49e0..df73ebb75 100644 --- a/main.sh +++ b/main.sh @@ -49,7 +49,7 @@ date +"%d_%m_%Y-%H_%M_%S" > $DEST/debug/timestamp # compile.sh version checking ver1=$(awk -F"=" '/^# VERSION/ {print $2}' <$SRC/compile.sh ) ver2=$(awk -F"=" '/^# VERSION/ {print $2}' <$SRC/lib/compile.sh 2>/dev/null) || ver2=0 -if [[ -z $ver1 || $ver1 -lt $ver2 ]]; then +if [[ $BETA != yes && ( -z $ver1 || $ver1 -lt $ver2 ) ]]; then display_alert "File $0 is outdated. Please overwrite it with an updated version from" "$SRC/lib" "wrn" echo -e "Press \e[0;33m\x1B[0m to abort compilation, \e[0;33m\x1B[0m to ignore and continue" read