From fd213ff4b00e630e84f8895100bf65432937638f Mon Sep 17 00:00:00 2001 From: Pete Date: Mon, 4 Dec 2023 12:48:39 +0000 Subject: [PATCH] Make calling mka switchable --- src/build.sh | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/src/build.sh b/src/build.sh index abc2259..c4c65b6 100755 --- a/src/build.sh +++ b/src/build.sh @@ -394,20 +394,22 @@ for branch in ${BRANCH_NAME//,/ }; do /root/userscripts/pre-build.sh "$codename" &>> "$DEBUG_LOG" || echo ">> [$(date)] Warning: pre-build.sh failed!" fi - # Start the build - echo ">> [$(date)] Starting build for $codename, $branch branch" | tee -a "$DEBUG_LOG" - build_successful=false - if (set +eu ; mka "${jobs_arg[@]}" bacon) &>> "$DEBUG_LOG"; then + build_successful=true + if [ "$CALL_MKA" = true ]; then + # Start the build + echo ">> [$(date)] Starting build for $codename, $branch branch" | tee -a "$DEBUG_LOG" + build_successful=false + if (set +eu ; mka "${jobs_arg[@]}" bacon) &>> "$DEBUG_LOG"; then - # Move produced ZIP files to the main OUT directory - echo ">> [$(date)] Moving build artifacts for $codename to '$ZIP_DIR/$zipsubdir'" | tee -a "$DEBUG_LOG" - cd out/target/product/"$codename" - files_to_hash=() - for build in lineage-*.zip; do - cp -v system/build.prop "$ZIP_DIR/$zipsubdir/$build.prop" &>> "$DEBUG_LOG" - mv "$build" "$ZIP_DIR/$zipsubdir/" &>> "$DEBUG_LOG" - files_to_hash+=( "$build" ) - done + # Move produced ZIP files to the main OUT directory + echo ">> [$(date)] Moving build artifacts for $codename to '$ZIP_DIR/$zipsubdir'" | tee -a "$DEBUG_LOG" + cd out/target/product/"$codename" + files_to_hash=() + for build in lineage-*.zip; do + cp -v system/build.prop "$ZIP_DIR/$zipsubdir/$build.prop" &>> "$DEBUG_LOG" + mv "$build" "$ZIP_DIR/$zipsubdir/" &>> "$DEBUG_LOG" + files_to_hash+=( "$build" ) + done cd "$source_dir/out/target/product/$codename/obj/PACKAGING/target_files_intermediates/lineage_$codename-target_files-eng.root/IMAGES/" for image in recovery boot vendor_boot dtbo super_empty vbmeta vendor_kernel_boot; do @@ -424,9 +426,13 @@ for branch in ${BRANCH_NAME//,/ }; do done cd "$source_dir" build_successful=true + else + echo ">> [$(date)] Failed build for $codename" | tee -a "$DEBUG_LOG" + fi else - echo ">> [$(date)] Failed build for $codename" | tee -a "$DEBUG_LOG" - fi + echo ">> [$(date)] Calling mka for $codename, $branch branch disabled" + fi + # Remove old zips and logs if [ "$DELETE_OLD_ZIPS" -gt "0" ]; then