Archive and unarchive EZFIO input files works

This commit is contained in:
Anthony Scemama 2014-04-04 01:34:33 +02:00
parent f0cba523df
commit 99b4de3939
4 changed files with 41 additions and 2 deletions

View File

@ -2,5 +2,8 @@ all: $(wildcard *.ezfio)
FORCE:
%.ezfio.md5: FORCE
archive_ezfio.sh $*.ezfio
%.ezfio: FORCE
archive_ezfio.sh $*
unarchive_ezfio.sh $@.md5

View File

@ -1,4 +1,3 @@
765e1f05dd3fbab8c7ebefaf2f1813e4 Ne_dz.ezfio/nuclei/nucl_num
3a99bcfcbfc32219791e6980c927b900 Ne_dz.ezfio/ao_basis/ao_coef.gz
54485b685f849c6f24a9c08a926daaf9 Ne_dz.ezfio/ao_basis/ao_expo.gz
2cf8c46d0cf91710e14856c92bcd0aae Ne_dz.ezfio/ao_basis/ao_nucl.gz

View File

@ -59,6 +59,7 @@ EOF
))
cd $OLDPWD
rm -f ${EZFIO_FILE}.md5
for FILE in ${FILES[@]}
do
FILE=${EZFIO_FILE}/${FILE}

36
scripts/unarchive_ezfio.sh Executable file
View File

@ -0,0 +1,36 @@
#!/bin/bash
#
# Reads a *.ezfio.md5 file, then fetches the proper data in the
# cache and re-creates the EZFIO database.
# Fri Apr 4 01:02:53 CEST 2014
if [[ -z ${QPACKAGE_ROOT} ]]
then
print "The QPACKAGE_ROOT environment variable is not set."
print "Please reload the quantum_package.rc file."
fi
EZFIO_FILE=$(basename $(basename ${1} .md5))
if [[ -z $1 ]]
then
echo "Usage: $(basename $0) <EZFIO_FILE.md5>"
exit 1
fi
if [[ ! -f ${EZFIO_FILE}.md5 ]]
then
echo "Error: ${EZFIO_FILE}.md5 does not exist."
exit 1
fi
key=($(cut -d ' ' -f 1 Ne_dz.ezfio.md5 ))
filename=($(cut -d ' ' -f 2 Ne_dz.ezfio.md5 ))
for i in ${!key[@]}
do
MD5=${key[$i]}
file=${filename[$i]}
mkdir -p $(dirname $file)
cp ${QPACKAGE_ROOT}/data/cache/${MD5} ${file}
done