# HG changeset patch # User Xerxes R?nby # Date 1299075916 -3600 # Node ID 64749190d7728aa8f7d55557bb26fef93ae31c22 # Parent 72316564535a95c59a93bc3f6c0229564b21c520 wget.cache.wrapper: Fix regression when wget URL -O subdir/file 2011-03-02 Xerxes Ranby * buildslave/tools/wget.cache.wrapper Fix regression when wget URL -O subdir/file diff -r 72316564535a -r 64749190d772 buildslave/tools/wget.cache.wrapper --- a/buildslave/tools/wget.cache.wrapper Wed Mar 02 11:45:22 2011 +0100 +++ b/buildslave/tools/wget.cache.wrapper Wed Mar 02 15:25:16 2011 +0100 @@ -35,13 +35,14 @@ ARG=$2 FILE=$3 +CACHEDIRSUBPATH=$(dirname ${FILE}) + if [ ${ARG} == "-O" ] ; then if [ ! -e ${CACHEDIR}${URL}/${FILE} ]; then # file do not exist in cache # download the file to the cache using wget! # make sure subdirs in the cache exist - CACHEDIRSUBPATH=$(dirname ${FILE}) mkdir -p ${CACHEDIR}${PID}/${URL}/${CACHEDIRSUBPATH} mkdir -p ${CACHEDIR}${URL}/${CACHEDIRSUBPATH} @@ -50,13 +51,14 @@ ${WGET} ${ALLARG} # atomically move the downloaded file to the main cache. - mv ${CACHEDIR}${PID}/${URL}/${FILE} ${CACHEDIR}${URL}/ + mv ${CACHEDIR}${PID}/${URL}/${FILE} ${CACHEDIR}${URL}/${FILE} fi if [ -e ${CACHEDIR}${URL}/${FILE} ] ; then # ok good, file exist now in cache # copy the file from cache to destination cd ${TARGETDIR} + mkdir -p ${CACHEDIRSUBPATH} cp ${CACHEDIR}${URL}/${FILE} ${FILE} exit 0 else