janus-gateway: make video call plugin optional
[buildroot-gz.git] / support / download / cp
blob0ee1f3ba8234ab2ca1abf653913e6fb4b48e0336
1 #!/usr/bin/env bash
3 # We want to catch any unexpected failure, and exit immediately
4 set -e
6 # Download helper for cp, to be called from the download wrapper script
8 # Call it as:
9 # .../cp [-q] OUT_FILE SRC_FILE
11 # Environment:
12 # LOCALFILES: the cp command to call
14 # 'cp' usually does not print anything on its stdout, whereas the
15 # other download backends, even if not verbose, at least print some
16 # progress information.
17 # Make 'cp' verbose by default, so it behaves a bit like the others.
18 verbose=-v
20 while getopts :q OPT; do
21 case "${OPT}" in
22 q) verbose=;;
23 \?) printf "unknown option '%s'\n" "${OPTARG}" >&2; exit 1;;
24 esac
25 done
26 shift $((OPTIND-1))
28 output="${1}"
29 source="${2}"
31 shift 2 # Get rid of our options
33 # Caller needs to single-quote its arguments to prevent them from
34 # being expanded a second time (in case there are spaces in them)
35 _localfiles() {
36 eval ${LOCALFILES} "${@}"
39 _localfiles ${verbose} "${@}""'${source}'" "'${output}'"