diff --git a/build-community.sh b/build-community.sh index ad88f988335efdb154084cf0df1b7d384b555b55..84d375f2d81a612a97067364e788cfee3411233c 100755 --- a/build-community.sh +++ b/build-community.sh @@ -66,7 +66,7 @@ if [ "$LOCAL_MIRROR" = true ]; then fi echo ">> [$(date)] Syncing mirror repository" | tee -a "$repo_log" - repo sync --force-sync --no-clone-bundle &>> "$repo_log" + repo sync -j$(nproc --all) --force-sync --no-clone-bundle &>> "$repo_log" if [ $? != 0 ]; then sync_successful=false @@ -163,7 +163,7 @@ for branch in ${BRANCH_NAME//,/ }; do echo ">> [$(date)] Syncing branch repository" | tee -a "$repo_log" builddate=$(date +%Y%m%d) - repo sync -c --force-sync &>> "$repo_log" + repo sync -c -j$(nproc --all) --force-sync &>> "$repo_log" if [ $? != 0 ]; then sync_successful=false @@ -235,7 +235,7 @@ for branch in ${BRANCH_NAME//,/ }; do if [ "$LOCAL_MIRROR" = true ]; then echo ">> [$(date)] Syncing mirror repository" | tee -a "$repo_log" cd "$MIRROR_DIR" - repo sync --force-sync --no-clone-bundle &>> "$repo_log" + repo sync -j$(nproc --all) --force-sync --no-clone-bundle &>> "$repo_log" if [ $? != 0 ]; then sync_successful=false diff --git a/src/build.sh b/src/build.sh index f6e3cd7075e1404ba3429bc23d6ce56561fdf028..e4fe4a44736d35d19bb7dfbd2d7acd496873e88e 100755 --- a/src/build.sh +++ b/src/build.sh @@ -34,7 +34,7 @@ fi sync_successful=true use_openjdk_from_ubuntu=false -branch_dir=$(sed -E 's/^v[0-9](\.[0-9]*){0,2}(-(beta|alpha|rc)(\.[0-9]*){0,1}){0,1}-(nougat|oreo|pie|q|r)(-[a-zA-Z0-9_]*)*$/\5/' <<< "${BRANCH_NAME}") +branch_dir=$(sed -E 's/^v[0-9](\.[0-9]*){0,2}(-(beta|alpha|rc)(\.[0-9]*){0,1}){0,1}-(nougat|oreo|pie|q|r|s)(-[a-zA-Z0-9_]*)*$/\5/' <<< "${BRANCH_NAME}") branch_dir=${branch_dir^^} if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then @@ -119,7 +119,7 @@ if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then echo ">> [$(date)] Syncing branch repository" builddate=$(date +%Y%m%d) - repo_out=$(repo sync -c --force-sync 2>&1 > /dev/null) + repo_out=$(repo sync -c -j$(nproc --all) --force-sync 2>&1 > /dev/null) repo_status=$? echo -e $repo_out @@ -189,7 +189,7 @@ if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then cd "$SRC_DIR/$branch_dir" || return 1 - if ! repo sync -c --force-sync; then + if ! repo sync -c -j$(nproc --all) --force-sync; then sync_successful=false build_device=false fi