clone-repos 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #!/bin/bash
  2. # cd into the directory containing this script (from the bash faq 028)
  3. if [[ $BASH_SOURCE = */* ]]; then
  4. cd -- "${BASH_SOURCE%/*}/" || exit
  5. fi
  6. cd ..
  7. fetch_repo() {
  8. repo_url="$1"
  9. commit_id="$2"
  10. dir_name="$3"
  11. if [ -d "$dir_name" ]; then
  12. ( cd "$dir_name" && git fetch origin --tags && \
  13. git checkout "$commit_id" )
  14. else
  15. git clone "$repo_url" "$dir_name" && \
  16. ( cd "$dir_name" && git checkout "$commit_id" && \
  17. if [ -e "../patches/${dir_name}.diff" ]; then
  18. patch -p1 < ../patches/${dir_name}.diff
  19. fi )
  20. fi
  21. }
  22. fetch_repos() {
  23. fetch_repo https://github.com/arkworks-rs/spongefish v0.4.0 spongefish && \
  24. fetch_repo https://github.com/mmaker/sigma-rs v0.2.1 sigma-proofs && \
  25. fetch_repo https://git-crysp.uwaterloo.ca/SigmaProtocol/sigma-compiler 0.2.1 sigma-compiler && \
  26. fetch_repo https://git-crysp.uwaterloo.ca/SigmaProtocol/cmz 0.2.1 cmz && \
  27. fetch_repo gogs@git-crysp.uwaterloo.ca:iang/onyinyang-lox-fork.git artifact application-lox && \
  28. fetch_repo gogs@git-crysp.uwaterloo.ca:iang/onyinyang-lox-fork.git artifact-zkp application-lox-zkp && \
  29. # fetch_repo https://gitlab.torproject.org/onyinyang/lox.git/ XXXXXXX application-lox && \
  30. # fetch_repo https://gitlab.torproject.org/onyinyang/lox.git/ XXXXXXX application-lox-zkp && \
  31. fetch_repo https://github.com/ooni/userauth atifact-v0.1 application-ooni
  32. }
  33. fetch_repos