3 # We want to catch any unexpected failure, and exit immediately
6 # Download helper for cvs, to be called from the download wrapper script
9 # .../cvs [-q] OUT_FILE CVS_URL REV PKG_NAME BASENAME
12 # CVS : the cvs command to call
15 while getopts :q OPT
; do
18 \?) printf "unknown option '%s'\n" "${OPTARG}" >&2; exit 1;;
29 shift 5 # Get rid of our options
31 # Caller needs to single-quote its arguments to prevent them from
32 # being expanded a second time (in case there are spaces in them)
37 if [[ ${rev} =~ ^
[0-9] ]]; then
38 # Date, because a tag or a branch cannot begin with a number
45 # The absence of an initial : on ${repo} means access method undefined
46 if [[ ! "${repo}" =~ ^
: ]]; then
47 # defaults to anonymous pserver
48 repo
=":pserver:anonymous@${repo}"
52 _cvs
${verbose} -z3 -d"'${repo}'" \
53 co
"${@}" -d "'${basename}'" ${select} "'${rev}'" -P "'${rawname}'"
55 tar czf
"${output}" "${basename}"