diff --git a/lib/libalpm/util.c b/lib/libalpm/util.c index d33eef2a..d4375593 100644 --- a/lib/libalpm/util.c +++ b/lib/libalpm/util.c @@ -849,12 +849,16 @@ const char *_alpm_filecache_setup(alpm_handle_t *handle) for(i = handle->cachedirs; i; i = i->next) { cachedir = i->data; if(stat(cachedir, &buf) != 0) { - /* cache directory does not exist.... try creating it */ - _alpm_log(handle, ALPM_LOG_WARNING, _("no %s cache exists, creating...\n"), - cachedir); - if(_alpm_makepath(cachedir) == 0) { - _alpm_log(handle, ALPM_LOG_DEBUG, "using cachedir: %s\n", cachedir); - return cachedir; + if (errno == EACCES) { + _alpm_log(handle, ALPM_LOG_WARNING, _("failed to stat %s: %s\n"), cachedir, strerror(errno)); + } else { + /* cache directory does not exist.... try creating it */ + _alpm_log(handle, ALPM_LOG_WARNING, _("no %s cache exists, creating...\n"), + cachedir); + if(_alpm_makepath(cachedir) == 0) { + _alpm_log(handle, ALPM_LOG_DEBUG, "using cachedir: %s\n", cachedir); + return cachedir; + } } } else if(!S_ISDIR(buf.st_mode)) { _alpm_log(handle, ALPM_LOG_DEBUG,