Support mirrors within

This commit is contained in:
fosslinux 2024-12-27 16:04:03 +11:00
parent 88ea21dfc9
commit df1c9e9aba
39 changed files with 159 additions and 83 deletions

View file

@ -9,10 +9,19 @@
download_source() {
local distfiles="${1}"
local url="${2}"
local checksum="${3}"
local fname="${4}"
shift 2
if [[ "${url}" == git://* ]]; then
url="${1}"
shift
fi
local checksum="${1}"
local fname="${2}"
# Default to basename of url if not given
fname="${fname:-$(basename "${url}")}"
if [ "${fname}" = "_" ]; then
echo "ERROR: ${url} must have a filename specified"
exit 1
fi
local dest_path="${distfiles}/${fname}"
if ! [ -e "${dest_path}" ]; then