xbps-repo: [clean] do not fail if cachedir does not exist, update for new API.

This commit is contained in:
Juan RP 2012-06-19 10:52:57 +02:00
parent 8abd275bfb
commit f4e97228c8

View File

@ -43,12 +43,8 @@ cachedir_clean(struct xbps_handle *xhp)
char *binpkg;
int rv = 0;
dirp = opendir(xhp->cachedir);
if (dirp == NULL) {
xbps_error_printf("cannot access to cachedir %s: %s\n",
xhp->cachedir, strerror(errno));
return errno;
}
if ((dirp = opendir(xhp->cachedir)) == NULL)
return 0;
while ((dp = readdir(dirp)) != NULL) {
if ((strcmp(dp->d_name, ".") == 0) ||
@ -86,7 +82,6 @@ cachedir_clean(struct xbps_handle *xhp)
dp->d_name);
unlink(binpkg);
}
prop_object_release(repo_pkgd);
free(binpkg);
continue;
}