From ccd83a5e9cc24833e1ab098cac1688f69ab6e9b6 Mon Sep 17 00:00:00 2001 From: Will Miles Date: Wed, 14 Jan 2015 18:19:13 -0500 Subject: 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. --- init.d/savecache.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.d/savecache.in b/init.d/savecache.in index dde02ddf..4fcf3db5 100644 --- a/init.d/savecache.in +++ b/init.d/savecache.in @@ -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" -- cgit v1.2.3