xbps-{bin,repo}: ignore ENOENT when checking write perms in {root,meta,cache}dir.
This commit is contained in:
parent
68a0223c4e
commit
f0ab396036
@ -243,11 +243,13 @@ main(int argc, char **argv)
|
|||||||
if ((access(xh.rootdir, W_OK) == -1) ||
|
if ((access(xh.rootdir, W_OK) == -1) ||
|
||||||
(access(xh.metadir, W_OK) == -1) ||
|
(access(xh.metadir, W_OK) == -1) ||
|
||||||
(access(xh.cachedir, W_OK) == -1)) {
|
(access(xh.cachedir, W_OK) == -1)) {
|
||||||
xbps_error_printf("xbps-bin: cannot write to "
|
if (errno != ENOENT) {
|
||||||
"rootdir/cachedir/metadir: %s\n",
|
xbps_error_printf("xbps-bin: cannot write to "
|
||||||
strerror(errno));
|
"rootdir/cachedir/metadir: %s\n",
|
||||||
xbps_end(&xh);
|
strerror(errno));
|
||||||
exit(EXIT_FAILURE);
|
xbps_end(&xh);
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -158,10 +158,12 @@ main(int argc, char **argv)
|
|||||||
(strcasecmp(argv[0], "clean") == 0)) {
|
(strcasecmp(argv[0], "clean") == 0)) {
|
||||||
if ((access(xh.metadir, W_OK) == -1) ||
|
if ((access(xh.metadir, W_OK) == -1) ||
|
||||||
(access(xh.cachedir, W_OK) == -1)) {
|
(access(xh.cachedir, W_OK) == -1)) {
|
||||||
xbps_error_printf("xbps-repo: cannot write to "
|
if (errno != ENOENT) {
|
||||||
"cachedir/metadir: %s\n", strerror(errno));
|
xbps_error_printf("xbps-repo: cannot write to "
|
||||||
xbps_end(&xh);
|
"cachedir/metadir: %s\n", strerror(errno));
|
||||||
exit(EXIT_FAILURE);
|
xbps_end(&xh);
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user