diff options
author | Will Miles <wmiles@sgl.com> | 2015-01-14 18:19:13 -0500 |
---|---|---|
committer | William Hubbs <w.d.hubbs@gmail.com> | 2015-03-20 17:21:57 -0500 |
commit | ccd83a5e9cc24833e1ab098cac1688f69ab6e9b6 (patch) | |
tree | a46c111216b4791241c549e9d9a13c5e6bd3de40 | |
parent | 7bbb73574b44972b0c1b364e24f71623068d7a1c (diff) |
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.
-rw-r--r-- | init.d/savecache.in | 2 |
1 files changed, 1 insertions, 1 deletions
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" |