xbps-repo: [clean] do not fail if cachedir does not exist, update for new API.
This commit is contained in:
parent
8abd275bfb
commit
f4e97228c8
@ -43,12 +43,8 @@ cachedir_clean(struct xbps_handle *xhp)
|
|||||||
char *binpkg;
|
char *binpkg;
|
||||||
int rv = 0;
|
int rv = 0;
|
||||||
|
|
||||||
dirp = opendir(xhp->cachedir);
|
if ((dirp = opendir(xhp->cachedir)) == NULL)
|
||||||
if (dirp == NULL) {
|
return 0;
|
||||||
xbps_error_printf("cannot access to cachedir %s: %s\n",
|
|
||||||
xhp->cachedir, strerror(errno));
|
|
||||||
return errno;
|
|
||||||
}
|
|
||||||
|
|
||||||
while ((dp = readdir(dirp)) != NULL) {
|
while ((dp = readdir(dirp)) != NULL) {
|
||||||
if ((strcmp(dp->d_name, ".") == 0) ||
|
if ((strcmp(dp->d_name, ".") == 0) ||
|
||||||
@ -86,7 +82,6 @@ cachedir_clean(struct xbps_handle *xhp)
|
|||||||
dp->d_name);
|
dp->d_name);
|
||||||
unlink(binpkg);
|
unlink(binpkg);
|
||||||
}
|
}
|
||||||
prop_object_release(repo_pkgd);
|
|
||||||
free(binpkg);
|
free(binpkg);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user