#! /bin/sh set -e srcdir="$(dirname "$0")" test -z "$srcdir" && srcdir=. cd "$srcdir" clone_repo_commit() { if test -d "$2/.git"; then git -C "$2" reset --hard git -C "$2" clean -fd if ! git -C "$2" -c advice.detachedHead=false checkout $3; then rm -rf "$2" fi else if test -d "$2"; then echo "error: '$2' is not a Git repository" 1>&2 exit 1 fi fi if ! test -d "$2"; then git clone $1 "$2" if ! git -C "$2" -c advice.detachedHead=false checkout $3; then rm -rf "$2" exit 1 fi fi } rm -f .deps-obtained clone_repo_commit \ https://codeberg.org/OSDev/freestnd-c-hdrs.git \ freestnd-c-hdrs \ 5e11c3da645d8f203e93dc23703b14a15c5b7afc clone_repo_commit \ https://codeberg.org/OSDev/freestnd-cxx-hdrs.git \ freestnd-cxx-hdrs \ 9d6a92ab19a57140f1e3ecc6668014d7f46094b6 clone_repo_commit \ https://codeberg.org/OSDev/cc-runtime.git \ cc-runtime \ dae79833b57a01b9fd3e359ee31def69f5ae899b clone_repo_commit \ https://codeberg.org/Limine/limine-protocol.git \ limine-protocol \ 26519f1b598564db409e50d1d84eb30642d58ba3 clone_repo_commit \ https://codeberg.org/Mintsuki/Flanterm.git \ flanterm \ 26f631fcc15bb7faea83572213cae5a0287fc3de clone_repo_commit \ https://github.com/charlesnicholson/nanoprintf.git \ nanoprintf \ 47af8e576556d7be9621f431e442123eccc056d3 clone_repo_commit \ https://github.com/uACPI/uACPI.git \ uacpi \ e05715b2e6a3ae913aecdb86f4fd2dba30304e45 touch .deps-obtained printf "\nDependencies obtained successfully.\n"