Commit 5ade3d6c by Maarten L. Hekkelman

Fixes in update data script

parent 0d8e548f
...@@ -1582,7 +1582,7 @@ void PDBFileParser::ParseTitle() ...@@ -1582,7 +1582,7 @@ void PDBFileParser::ParseTitle()
if (not iequals(key, "MOL_ID") and mCompounds.empty()) if (not iequals(key, "MOL_ID") and mCompounds.empty())
{ {
if (cif::VERBOSE >= 0) if (cif::VERBOSE > 0)
std::cerr << "Ignoring invalid COMPND record" << std::endl; std::cerr << "Ignoring invalid COMPND record" << std::endl;
break; break;
} }
......
...@@ -30,12 +30,9 @@ fi ...@@ -30,12 +30,9 @@ fi
# Create a temp file in the right directory and # Create a temp file in the right directory and
# make sure it is cleaned up when this script exits # make sure it is cleaned up when this script exits
tmpfile=$(mktemp --tmpdir=@CIFPP_CACHE_DIR@) tmpfile=$(mktemp)
trap "rm -f \"${tmpfile}\"" EXIT trap "rm -f \"${tmpfile}\"" EXIT
# Record if updating was really necessary
updated=false
update_dictionary() { update_dictionary() {
dict=$1 dict=$1
source=$2 source=$2
...@@ -57,7 +54,7 @@ update_dictionary() { ...@@ -57,7 +54,7 @@ update_dictionary() {
cat > "${tmpfile}" cat > "${tmpfile}"
fi fi
) && ( ) && (
mv "${tmpfile}" "${dict}" && chmod a+r "${dict}" && updated=true mv "${tmpfile}" "${dict}" && chmod a+r "${dict}"
) || true ) || true
} }
...@@ -69,6 +66,6 @@ update_dictionary "@CIFPP_CACHE_DIR@/mmcif_ma.dic" "https://github.com/ihmwg/Mod ...@@ -69,6 +66,6 @@ update_dictionary "@CIFPP_CACHE_DIR@/mmcif_ma.dic" "https://github.com/ihmwg/Mod
# notify subscribers, will fail on FreeBSD # notify subscribers, will fail on FreeBSD
if [ "${updated}" != "false" ] && [ -d "@CIFPP_ETC_DIR@/libcifpp/cache-update.d" ] && [ -x /bin/run-parts ]; then if [ -d "@CIFPP_ETC_DIR@/libcifpp/cache-update.d" ] && [ -x /bin/run-parts ]; then
run-parts --arg "@CIFPP_CACHE_DIR@" -- "@CIFPP_ETC_DIR@/libcifpp/cache-update.d" run-parts --arg "@CIFPP_CACHE_DIR@" -- "@CIFPP_ETC_DIR@/libcifpp/cache-update.d"
fi fi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment