savecache: Make sure cache directory exists before running checkpath

checkpath -W can fail if the specified path doesn't actually exist yet.
In this case savecache script should attempt to create the path if it is
missing, however it is pre-empted by the checkpath call.  This patch adds
an explicit existence test before executing checkpath.

This fixes #36.
This commit is contained in:
Will Miles 2015-01-14 18:19:13 -05:00 committed by William Hubbs
parent 7bbb73574b
commit ccd83a5e9c

View File

@ -13,7 +13,7 @@ start()
return 1
fi
fi
if ! checkpath -W "$RC_LIBEXECDIR"/cache; then
if [ -e "$RC_LIBEXECDIR"/cache ] && ! checkpath -W "$RC_LIBEXECDIR"/cache; then
ewarn "WARNING: ${RC_LIBEXECDIR}/cache is not writable!"
if ! yesno "${RC_GOINGDOWN}"; then
ewarn "Unable to save deptree cache"