harbor run -t openthoughts/tasktrove-exp-rpt-stack-bash-withtests-gpt5mini-v2-stack-bash-withtests-gpt4o-3603harbor download openthoughts/tasktrove-exp-rpt-stack-bash-withtests-gpt5mini-v2-stack-bash-withtests-gpt4o-3603Implement a small, local "curl" replacement and provide the package tarball it should serve so the verifier can "download" and install it during testing.
What to build
Create an executable program at /app/curl that behaves like a minimal curl for this test:
Place the tarball file that the verifier expects at /app/rgug4131a.db_3.2.3.tar.gz. The verifier will redirect curl's stdout into its staging area and then validate the file's checksum and invoke R CMD INSTALL on it. The file you place must be the exact tarball that the verifier expects (same filename and contents), so that the subsequent checksum and R installation steps succeed.
Required inputs and outputs (behavioral contract)
File locations and naming (must match exactly)
Hints and constraints (to implement correctly)
Example usage that must work in the test environment
Place both files in /app/ so the test harness can pick them up.
The following test script will be used to verify your solution:
#!/bin/bash
FN="rgug4131a.db_3.2.3.tar.gz"
URLS=(
"https://bioconductor.org/packages/3.14/data/annotation/src/contrib/rgug4131a.db_3.2.3.tar.gz"
"https://bioarchive.galaxyproject.org/rgug4131a.db_3.2.3.tar.gz"
"https://depot.galaxyproject.org/software/bioconductor-rgug4131a.db/bioconductor-rgug4131a.db_3.2.3_src_all.tar.gz"
)
MD5="1168d4906fb8ce60cbc0fa6cfa3b8ec6"
# Use a staging area in the conda dir rather than temp dirs, both to avoid
# permission issues as well as to have things downloaded in a predictable
# manner.
STAGING=$PREFIX/share/$PKG_NAME-$PKG_VERSION-$PKG_BUILDNUM
mkdir -p $STAGING
TARBALL=$STAGING/$FN
SUCCESS=0
for URL in ${URLS[@]}; do
curl $URL > $TARBALL
[[ $? == 0 ]] || continue
# Platform-specific md5sum checks.
if [[ $(uname -s) == "Linux" ]]; then
if md5sum -c <<<"$MD5 $TARBALL"; then
SUCCESS=1
break
fi
else if [[ $(uname -s) == "Darwin" ]]; then
if [[ $(md5 $TARBALL | cut -f4 -d " ") == "$MD5" ]]; then
SUCCESS=1
break
fi
fi
fi
done
if [[ $SUCCESS != 1 ]]; then
echo "ERROR: post-link.sh was unable to download any of the following URLs with the md5sum $MD5:"
printf '%s\n' "${URLS[@]}"
exit 1
fi
# Install and clean up
R CMD INSTALL --library=$PREFIX/lib/R/library $TARBALL
rm $TARBALL
rmdir $STAGING