#!/bin/sh _path() { local path="$(url %h%p $1)" case "${path}" in *.git) echo "${path}";; *) echo "${path}.git";; esac } _update() { local repo="$1" local path="$(_path ${repo})" test -d "${path}" || git clone -q --mirror "${repo}" "${path}" git -C "${path}" fetch -q && echo "Updated ${path}" || echo "Failed to update ${path}" } list="${1:-repositories.list}" test -f "${list}" || exit 1 while read repo; do _update "${repo}" & done <"${list}" wait