mirror of
https://github.com/LCPQ/quantum_package
synced 2024-10-02 06:20:59 +02:00
Fetch input MD5 files from the web into cache directory
This commit is contained in:
parent
950876f794
commit
1e5c09f75a
@ -1,7 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# Reads a *.ezfio.md5 file, then fetches the proper data in the
|
# Reads a *.md5 file, then fetches the proper data in the
|
||||||
# cache and re-creates the EZFIO database.
|
# cache and re-creates the EZFIO database.
|
||||||
|
# If the cache data is not present, download it from
|
||||||
|
# $QPACKAGE_CACHE_URL
|
||||||
# Fri Apr 4 01:02:53 CEST 2014
|
# Fri Apr 4 01:02:53 CEST 2014
|
||||||
|
|
||||||
if [[ -z ${QPACKAGE_ROOT} ]]
|
if [[ -z ${QPACKAGE_ROOT} ]]
|
||||||
@ -27,10 +29,23 @@ fi
|
|||||||
key=($(cut -d ' ' -f 1 ${EZFIO_FILE}.md5))
|
key=($(cut -d ' ' -f 1 ${EZFIO_FILE}.md5))
|
||||||
filename=($(cut -d ' ' -f 2 ${EZFIO_FILE}.md5))
|
filename=($(cut -d ' ' -f 2 ${EZFIO_FILE}.md5))
|
||||||
|
|
||||||
|
if [[ -z ${QPACKAGE_CACHE_URL} ]]
|
||||||
|
then
|
||||||
|
echo "Error: The QPACKAGE_CACHE_URL environment variable is not set."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
for i in ${!key[@]}
|
for i in ${!key[@]}
|
||||||
do
|
do
|
||||||
MD5=${key[$i]}
|
MD5=${key[$i]}
|
||||||
file=${filename[$i]}
|
file=${filename[$i]}
|
||||||
mkdir -p $(dirname $file)
|
if [[ ! -d $file ]]
|
||||||
|
then
|
||||||
|
mkdir -p $(dirname $file)
|
||||||
|
fi
|
||||||
|
if [[ ! -f ${QPACKAGE_ROOT}/data/cache/${MD5} ]]
|
||||||
|
then
|
||||||
|
${QPACKAGE_ROOT}/scripts/fetch_from_web.py ${QPACKAGE_CACHE_URL}/${MD5} ${QPACKAGE_ROOT}/data/cache/${MD5}
|
||||||
|
fi
|
||||||
cp ${QPACKAGE_ROOT}/data/cache/${MD5} ${file}
|
cp ${QPACKAGE_ROOT}/data/cache/${MD5} ${file}
|
||||||
done
|
done
|
||||||
|
@ -24,7 +24,7 @@ export IRPF90=${IRPF90}
|
|||||||
export QPACKAGE_ROOT=${QPACKAGE_ROOT}
|
export QPACKAGE_ROOT=${QPACKAGE_ROOT}
|
||||||
export PATH+=:\${QPACKAGE_ROOT}/scripts
|
export PATH+=:\${QPACKAGE_ROOT}/scripts
|
||||||
export PATH+=:\${QPACKAGE_ROOT}/bin
|
export PATH+=:\${QPACKAGE_ROOT}/bin
|
||||||
export QPACKAGE_CACHE_URL="http://qmcchem.ups-tlse.fr/files/scemama/quantum_package/cache/"
|
export QPACKAGE_CACHE_URL="http://qmcchem.ups-tlse.fr/files/scemama/quantum_package/cache"
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
source quantum_package.rc
|
source quantum_package.rc
|
||||||
|
Loading…
Reference in New Issue
Block a user