GRIB-677: download.sh does not behave correctly

This commit is contained in:
Shahram Najm 2015-01-29 22:58:10 +00:00
parent 7c9163786d
commit 709c0aeaeb
4 changed files with 24 additions and 10 deletions

View File

@ -23,7 +23,7 @@ else
endif
SUBDIRS = src tools definitions samples ifs_samples/grib1 ifs_samples/grib1_mlgrib2 ifs_samples/grib1_mlgrib2_ieee64 \
tests tigge $(FORTRAN_MOD) examples/C $(F90_CHECK) $(PERL_OPT) $(PYTHON_OPT) examples/python
tests tigge $(FORTRAN_MOD) examples/C $(F90_CHECK) $(PERL_OPT) $(PYTHON_OPT) examples/python data
EXTRA_DIST = README AUTHORS NOTICE LICENSE ChangeLog version.sh html \
src/extrules.am \

View File

@ -662,7 +662,7 @@ AC_CHECK_FUNCS([bzero gettimeofday])
AX_LINUX_DISTRIBUTION
AC_OUTPUT( Makefile src/Makefile fortran/Makefile tools/Makefile definitions/Makefile samples/Makefile ifs_samples/grib1/Makefile ifs_samples/grib1_mlgrib2/Makefile ifs_samples/grib1_mlgrib2_ieee64/Makefile tests/Makefile examples/C/Makefile examples/F90/Makefile tigge/Makefile perl/GRIB-API/Makefile.PL perl/Makefile python/Makefile examples/python/Makefile)
AC_OUTPUT( Makefile src/Makefile fortran/Makefile tools/Makefile data/Makefile definitions/Makefile samples/Makefile ifs_samples/grib1/Makefile ifs_samples/grib1_mlgrib2/Makefile ifs_samples/grib1_mlgrib2_ieee64/Makefile tests/Makefile examples/C/Makefile examples/F90/Makefile tigge/Makefile perl/GRIB-API/Makefile.PL perl/Makefile python/Makefile examples/python/Makefile)
AC_MSG_NOTICE([

View File

@ -1 +1,3 @@
EXTRA_DIST = CMakeLists.txt
clean-local:
@./download.sh -c .

View File

@ -11,6 +11,7 @@ usage ()
}
VERBOSE=0
CLEAN=0
while :
do
case "$1" in
@ -18,6 +19,9 @@ do
-v) VERBOSE=1
echo "Running with verbose setting"
;;
-c) CLEAN=1
echo "Cleaning downloaded files"
;;
--) shift ; break ;;
-*) usage ; exit 0;;
*) break;;
@ -32,14 +36,6 @@ if [ -z "$DATA_DIR" ]; then
exit 1
fi
# Check if all downloads are already done
if [ -f "${DATA_DIR}/.downloaded" ]; then
if [ $VERBOSE -eq 1 ]; then
echo "All downloads are already done. Exiting."
fi
exit 0
fi
files="
bad.grib
in_copy.grib
@ -778,6 +774,22 @@ files="
bufr/syno_multi.bufr.header.ref
"
if [ $CLEAN -eq 1 ]; then
for f in $files; do
rm -f $f
rm -f ".downloaded"
done
exit 0
fi
# Check if all downloads are already done
if [ -f "${DATA_DIR}/.downloaded" ]; then
if [ $VERBOSE -eq 1 ]; then
echo "All downloads are already done. Exiting."
fi
exit 0
fi
[ -d "${DATA_DIR}/tigge" ] || mkdir "${DATA_DIR}/tigge"
# Decide what tool to use to download data