commit:     ccd83a5e9cc24833e1ab098cac1688f69ab6e9b6
Author:     Will Miles <wmiles <AT> sgl <DOT> com>
AuthorDate: Wed Jan 14 23:19:13 2015 +0000
Commit:     William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Fri Mar 20 22:21:57 2015 +0000
URL:        https://gitweb.gentoo.org/proj/openrc.git/commit/?id=ccd83a5e

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 dde02dd..4fcf3db 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"

Reply via email to