From 0fc959c15c1fd77bb5879b724194944baa88de6b Mon Sep 17 00:00:00 2001 From: althafvly Date: Mon, 29 Jul 2024 20:22:45 +0530 Subject: [PATCH 1/2] docker: Fix android version check --- src/build.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/build.sh b/src/build.sh index da30dfc..7758374 100755 --- a/src/build.sh +++ b/src/build.sh @@ -351,11 +351,15 @@ if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then build_success=true fi elif [ "${IS_EMULATOR}" = true ]; then - if breakfast_device && mka; then - if ( [ "$android_version_major" -lt "13" ] && mka sdk_addon ) || mka emu_img_zip; then + if breakfast_device; then + if [ "$android_version_major" -lt "14" ]; then + if mka sdk_addon; then + build_success=true + fi + elif mka && mka emu_img_zip; then build_success=true fi - fi + fi elif [ "$android_version_major" -lt "12" ]; then if [ "${BUILD_SUPER_IMAGE}" = true ]; then if breakfast_device && mka bacon superimage; then -- GitLab From c97f213aece516ae38ff154d44ed6dd90b0f0a8c Mon Sep 17 00:00:00 2001 From: althafvly Date: Mon, 29 Jul 2024 20:23:03 +0530 Subject: [PATCH 2/2] docker: Fix script format --- build-community.sh | 2 +- src/build.sh | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/build-community.sh b/build-community.sh index 947b025..f661c5e 100755 --- a/build-community.sh +++ b/build-community.sh @@ -22,7 +22,7 @@ repo_log="$LOGS_DIR/repo-$(date +%Y%m%d).log" # Determine the number of parallel jobs to use for repo sync nproc_value=$(nproc --all) -JOBS=$(( nproc_value > 10 ? 10 : nproc_value )) +JOBS=$((nproc_value > 10 ? 10 : nproc_value)) # cd to working directory cd "$SRC_DIR" diff --git a/src/build.sh b/src/build.sh index 7758374..ab2267b 100755 --- a/src/build.sh +++ b/src/build.sh @@ -22,7 +22,7 @@ cd "$SRC_DIR" || return 1 # Determine the number of parallel jobs to use for repo sync nproc_value=$(nproc --all) -JOBS=$(( nproc_value > 10 ? 10 : nproc_value )) +JOBS=$((nproc_value > 10 ? 10 : nproc_value)) if [ -f /root/userscripts/begin.sh ]; then echo ">> [$(date)] Running begin.sh" @@ -352,13 +352,13 @@ if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then fi elif [ "${IS_EMULATOR}" = true ]; then if breakfast_device; then - if [ "$android_version_major" -lt "14" ]; then - if mka sdk_addon; then - build_success=true - fi - elif mka && mka emu_img_zip; then + if [ "$android_version_major" -lt "14" ]; then + if mka sdk_addon; then build_success=true fi + elif mka && mka emu_img_zip; then + build_success=true + fi fi elif [ "$android_version_major" -lt "12" ]; then if [ "${BUILD_SUPER_IMAGE}" = true ]; then @@ -691,9 +691,9 @@ if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then if [ "$IS_EMULATOR" = true -a "$BACKUP_EMULATOR" = true ]; then EMULATOR_ARCHIVE="IMG-e-$(grep lineage.version system/build.prop | sed s/#.*// | sed s/.*=// | tr -d '\n').zip" if [ "$android_version_major" -gt "13" ]; then - mv sdk-repo-linux-system-images.zip "$ZIP_DIR/$zipsubdir/$EMULATOR_ARCHIVE" + mv sdk-repo-linux-system-images.zip "$ZIP_DIR/$zipsubdir/$EMULATOR_ARCHIVE" else - mv ../../../host/linux-x86/sdk_addon/*-img.zip "$ZIP_DIR/$zipsubdir/$EMULATOR_ARCHIVE" + mv ../../../host/linux-x86/sdk_addon/*-img.zip "$ZIP_DIR/$zipsubdir/$EMULATOR_ARCHIVE" fi pushd "$ZIP_DIR/$zipsubdir" sha256sum "$EMULATOR_ARCHIVE" >"$EMULATOR_ARCHIVE.sha256sum" -- GitLab