diff --git a/src/new_build.sh b/src/new_build.sh index d92d4d98..98a25e49 100755 --- a/src/new_build.sh +++ b/src/new_build.sh @@ -115,10 +115,10 @@ echo ">> [$(date)] Devices: $devices" vendor=lineage ## Check for non-working environment variable values -if [ "$LOCAL_MIRROR" = true ]; then - echo "Using LOCAL_MIRROR is not yet working" - exit 1 -fi +# if [ "$LOCAL_MIRROR" = true ]; then +# echo "Using LOCAL_MIRROR is not yet working" +# exit 1 +# fi if [ "$BUILD_OVERLAY" = true ]; then echo "Using BUILD_OVERLAY is not yet working" @@ -191,24 +191,23 @@ rsync -a --delete --include '*.xml' --exclude '*' "$LMANIFEST_DIR/" .repo/local_ # Sync mirror if we're using one if [ "$LOCAL_MIRROR" = true ]; then - echo "Using LOCAL_MIRROR is not yet working" - - # cd "$MIRROR_DIR" - # if [ "$INIT_MIRROR" = true ]; then - # if [ ! -d .repo ]; then - # echo ">> [$(date)] Initializing mirror repository" | tee -a "$repo_log" - # ( yes||: ) | repo init -u https://github.com/LineageOS/mirror --mirror --no-clone-bundle -p linux --git-lfs &>> "$repo_log" - # fi - # else - # echo ">> [$(date)] Initializing mirror repository disabled" | tee -a "$repo_log" - # fi - # if [ "$SYNC_MIRROR" = true ]; then - # echo ">> [$(date)] Syncing mirror repository" | tee -a "$repo_log" - # repo sync "${jobs_arg[@]}" "${retry_fetches_arg[@]}" --force-sync --no-clone-bundle &>> "$repo_log" - # - # else - # echo ">> [$(date)] Sync mirror repository disabled" | tee -a "$repo_log" - # fi + + cd "$MIRROR_DIR" + if [ "$INIT_MIRROR" = true ]; then + if [ ! -d .repo ]; then + echo ">> [$(date)] Initializing mirror repository" | tee -a "$repo_log" + ( yes||: ) | repo init -u https://github.com/LineageOS/mirror --mirror --no-clone-bundle -p linux --git-lfs &>> "$repo_log" + fi + else + echo ">> [$(date)] Initializing mirror repository disabled" | tee -a "$repo_log" + fi + if [ "$SYNC_MIRROR" = true ]; then + echo ">> [$(date)] Syncing mirror repository" | tee -a "$repo_log" + repo sync "${jobs_arg[@]}" "${retry_fetches_arg[@]}" --force-sync --no-clone-bundle &>> "$repo_log" + + else + echo ">> [$(date)] Sync mirror repository disabled" | tee -a "$repo_log" + fi fi