3 # We want to catch any unexpected failure, and exit immediately
7 # Download helper for cp, to be called from the download wrapper script
11 # -o FILE Copy to file FILE.
12 # -f FILE Copy from basename file FILE.
13 # -u DIR Copy from FILE in DIR.
16 # LOCALFILES: the cp command to call
18 # 'cp' usually does not print anything on its stdout, whereas the
19 # other download backends, even if not verbose, at least print some
20 # progress information.
21 # Make 'cp' verbose by default, so it behaves a bit like the others.
24 while getopts "${BR_BACKEND_DL_GETOPTS}" OPT; do
27 o) output="${OPTARG}";;
30 :) printf "option '%s' expects a mandatory argument\n" "${OPTARG}"; exit 1;;
31 \?) printf "unknown option '%s'\n" "${OPTARG}" >&2; exit 1;;
35 shift $((OPTIND-1)) # Get rid of our options
37 # Caller needs to single-quote its arguments to prevent them from
38 # being expanded a second time (in case there are spaces in them)
40 eval ${LOCALFILES} "${@}"
43 _localfiles ${verbose} "'${dir##file://}/${file}'" "'${output}'"