mirror of
https://github.com/fosslinux/live-bootstrap.git
synced 2026-03-02 01:18:08 +01:00
Add script to download sysa and sysc distfiles without Python
This commit is contained in:
parent
44c35017e7
commit
6de12d402f
2 changed files with 41 additions and 0 deletions
40
download-distfiles.sh
Executable file
40
download-distfiles.sh
Executable file
|
|
@ -0,0 +1,40 @@
|
|||
#!/bin/sh
|
||||
|
||||
download_source() {
|
||||
local distfiles="${1}"
|
||||
local url="${2}"
|
||||
local checksum="${3}"
|
||||
local fname="${4}"
|
||||
# Default to basename of url if not given
|
||||
fname="${fname:-$(basename "${url}")}"
|
||||
|
||||
local dest_path="${distfiles}/${fname}"
|
||||
if ! [ -e "${dest_path}" ]; then
|
||||
echo "Downloading ${fname}"
|
||||
curl -L "${url}" --output "${dest_path}"
|
||||
fi
|
||||
echo "${checksum} ${dest_path}" | sha256sum -c
|
||||
}
|
||||
|
||||
download_for_sys() {
|
||||
local sysdir="${1}"
|
||||
local distfiles="${sysdir}/distfiles"
|
||||
|
||||
mkdir -p "${distfiles}"
|
||||
|
||||
local entry
|
||||
for entry in "${sysdir}"/*; do
|
||||
[ -e "${entry}/sources" ] || continue
|
||||
|
||||
local line
|
||||
while read line; do
|
||||
# This is intentional - we want to split out ${line} into separate arguments.
|
||||
download_source "${distfiles}" ${line}
|
||||
done < "${entry}/sources"
|
||||
done
|
||||
}
|
||||
|
||||
set -e
|
||||
cd "$(dirname "$(readlink -f "$0")")"
|
||||
download_for_sys sysa
|
||||
download_for_sys sysc
|
||||
Loading…
Add table
Add a link
Reference in a new issue