summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/libalpm/handle.c8
-rw-r--r--lib/libalpm/util.c3
2 files changed, 3 insertions, 8 deletions
diff --git a/lib/libalpm/handle.c b/lib/libalpm/handle.c
index 07828115..189c934f 100644
--- a/lib/libalpm/handle.c
+++ b/lib/libalpm/handle.c
@@ -362,7 +362,6 @@ int SYMEXPORT alpm_option_set_dbpath(const char *dbpath)
int SYMEXPORT alpm_option_add_cachedir(const char *cachedir)
{
- struct stat st;
char *newcachedir;
size_t cachedirlen;
@@ -372,10 +371,9 @@ int SYMEXPORT alpm_option_add_cachedir(const char *cachedir)
pm_errno = PM_ERR_WRONG_ARGS;
return(-1);
}
- if(stat(cachedir, &st) == -1 || !S_ISDIR(st.st_mode)) {
- pm_errno = PM_ERR_NOT_A_DIR;
- return(-1);
- }
+ /* don't stat the cachedir yet, as it may not even be needed. we can
+ * fail later if it is needed and the path is invalid. */
+
/* verify cachedir ends in a '/' */
cachedirlen = strlen(cachedir);
if(cachedir[cachedirlen-1] != '/') {
diff --git a/lib/libalpm/util.c b/lib/libalpm/util.c
index 851a7c25..64006d1f 100644
--- a/lib/libalpm/util.c
+++ b/lib/libalpm/util.c
@@ -571,8 +571,6 @@ const char *_alpm_filecache_setup(void)
/* cache directory does not exist.... try creating it */
_alpm_log(PM_LOG_WARNING, _("no %s cache exists, creating...\n"),
cachedir);
- alpm_logaction("warning: no %s cache exists, creating...\n",
- cachedir);
if(_alpm_makepath(cachedir) == 0) {
_alpm_log(PM_LOG_DEBUG, "using cachedir: %s\n", cachedir);
return(cachedir);
@@ -590,7 +588,6 @@ const char *_alpm_filecache_setup(void)
alpm_option_set_cachedirs(tmp);
_alpm_log(PM_LOG_DEBUG, "using cachedir: %s", "/tmp/\n");
_alpm_log(PM_LOG_WARNING, _("couldn't create package cache, using /tmp instead\n"));
- alpm_logaction("warning: couldn't create package cache, using /tmp instead\n");
return(alpm_list_getdata(tmp));
}