mirror of
https://github.com/fosslinux/live-bootstrap.git
synced 2026-03-02 01:18:08 +01:00
Remove unneeded double quotes
from download-distfiles.sh and mirror.sh
This commit is contained in:
parent
19c83b80da
commit
f3f140783d
2 changed files with 50 additions and 50 deletions
|
|
@ -7,54 +7,54 @@
|
|||
# Optional arguments: Mirrors
|
||||
|
||||
download_source() {
|
||||
local distfiles="${1}"
|
||||
local url="${2}"
|
||||
local distfiles=${1}
|
||||
local url=${2}
|
||||
shift 2
|
||||
if [[ "${url}" == git://* ]]; then
|
||||
url="${1}"
|
||||
if [[ ${url} == git://* ]]; then
|
||||
url=${1}
|
||||
shift
|
||||
fi
|
||||
local checksum="${1}"
|
||||
local fname="${2}"
|
||||
local checksum=${1}
|
||||
local fname=${2}
|
||||
# Default to basename of url if not given
|
||||
fname="${fname:-$(basename "${url}")}"
|
||||
fname=${fname:-$(basename "${url}")}
|
||||
if [ "${fname}" = "_" ]; then
|
||||
echo "ERROR: ${url} must have a filename specified"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
local dest_path="${distfiles}/${fname}"
|
||||
local dest_path=${distfiles}/${fname}
|
||||
if ! [ -e "${dest_path}" ]; then
|
||||
echo "Downloading ${fname}"
|
||||
if [ "${mirrors_len}" -ne 0 ]; then
|
||||
local mirror_ix="$((RANDOM % mirrors_len))"
|
||||
url="${mirrors[${mirror_ix}]}/${fname}"
|
||||
local mirror_ix=$((RANDOM % mirrors_len))
|
||||
url=${mirrors[${mirror_ix}]}/${fname}
|
||||
fi
|
||||
curl --fail --location "${url}" --output "${dest_path}" || true
|
||||
fi
|
||||
}
|
||||
|
||||
check_source() {
|
||||
local distfiles="${1}"
|
||||
local url="${2}"
|
||||
local distfiles=${1}
|
||||
local url=${2}
|
||||
shift 2
|
||||
if [[ "${url}" == git://* ]]; then
|
||||
url="${1}"
|
||||
if [[ ${url} == git://* ]]; then
|
||||
url=${1}
|
||||
shift
|
||||
fi
|
||||
local checksum="${1}"
|
||||
local fname="${2}"
|
||||
local checksum=${1}
|
||||
local fname=${2}
|
||||
# Default to basename of url if not given
|
||||
fname="${fname:-$(basename "${url}")}"
|
||||
fname=${fname:-$(basename "${url}")}
|
||||
|
||||
local dest_path="${distfiles}/${fname}"
|
||||
local dest_path=${distfiles}/${fname}
|
||||
echo "${checksum} ${dest_path}" | sha256sum -c
|
||||
}
|
||||
|
||||
set -e
|
||||
|
||||
mirrors=( "$@" )
|
||||
mirrors_len="$#"
|
||||
mirrors_len=$#
|
||||
|
||||
cd "$(dirname "$(readlink -f "$0")")"
|
||||
mkdir -p distfiles
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue