Skip to content

Commit

Permalink
Revert try fixing sync [skip ci]
Browse files Browse the repository at this point in the history
This reverts commit 590a76c.
  • Loading branch information
Apon77 committed Jan 27, 2023
1 parent 590a76c commit 9536d79
Showing 1 changed file with 0 additions and 72 deletions.
72 changes: 0 additions & 72 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,78 +143,6 @@ task:

- rm -rf sync.log

tsync_script:
- set -e
- rom_name=$(grep init $CIRRUS_WORKING_DIR/build_rom.sh -m 1 | cut -d / -f 4)
- branch_name=$(grep init $CIRRUS_WORKING_DIR/build_rom.sh | awk -F "-b " '{print $2}' | awk '{print $1}')
- rom_name=$rom_name-$branch_name
- mkdir -p ~/roms/$rom_name
- cd ~/roms/$rom_name

- set -exv
- curl -sO https://api.cirrus-ci.com/v1/task/$CIRRUS_TASK_ID/logs/sync.log
- a=$(grep 'Cannot remove project' sync.log -m1|| true)
- b=$(grep "^fatal: remove-project element specifies non-existent project" sync.log -m1 || true)
- c=$(grep 'repo sync has finished' sync.log -m1 || true)
- d=$(grep 'Failing repos:' sync.log -n -m1 || true)
- e=$(grep 'fatal: Unable' sync.log || true)
- f=$(grep 'error.GitError' sync.log || true)
- g=$(grep 'error: Cannot checkout' sync.log || true)
- if [[ $a == *'Cannot remove project'* ]]
- then
- a=$(echo $a | cut -d ':' -f2 | tr -d ' ')
- rm -rf $a
- fi
- if [[ $b == *'remove-project element specifies non-existent'* ]]
- then exit 1
- fi
- if [[ $d == *'Failing repos:'* ]]
- then
- d=$(expr $(grep 'Failing repos:' sync.log -n -m 1| cut -d ':' -f1) + 1)
- d2=$(expr $(grep 'Try re-running' sync.log -n -m1 | cut -d ':' -f1) - 1 )
- fail_paths=$(head -n $d2 sync.log | tail -n +$d)
- for path in $fail_paths
- do
- rm -rf $path
- aa=$(echo $path|awk -F '/' '{print $NF}')
- rm -rf .repo/project-objects/*$aa.git
- rm -rf .repo/projects/$path.git
- done
- fi
- if [[ $e == *'fatal: Unable'* ]]
- then
- fail_paths=$(grep 'fatal: Unable' sync.log | cut -d ':' -f2 | cut -d "'" -f2)
- for path in $fail_paths
- do
- rm -rf $path
- aa=$(echo $path|awk -F '/' '{print $NF}')
- rm -rf .repo/project-objects/*$aa.git
- rm -rf .repo/project-objects/$path.git
- rm -rf .repo/projects/$path.git
- done
- fi
- if [[ $f == *'error.GitError'* ]]
- then
- rm -rf $(grep 'error.GitError' sync.log | cut -d ' ' -f2)
- fi
- if [[ $g == *'error: Cannot checkout'* ]]
- then
- coerr=$(grep 'error: Cannot checkout' sync.log | cut -d ' ' -f 4| tr -d ':')
- for i in $coerr
- do
- rm -rf .repo/project-objects/$i.git
- done
- fi
#- (repo forall -c 'git checkout .' && bash -c "$only_sync") || (find -name shallow.lock -delete && find -name index.lock -delete && bash -c "$only_sync")

- if [[ $c == *'repo sync has finished'* ]]
- then true
- else
- repo sync -c --no-clone-bundle --no-tags --optimized-fetch --prune --force-sync -j$(nproc --all)
- fi

- rm -rf sync.log

build_script:
- set -e
- rom_name=$(grep init $CIRRUS_WORKING_DIR/build_rom.sh -m 1 | cut -d / -f 4)
Expand Down

0 comments on commit 9536d79

Please sign in to comment.