xbps_repo_open: open archive read-only if lock is not set.
This commit is contained in:
parent
013731c502
commit
bf92d1f5a3
@ -151,7 +151,11 @@ xbps_repo_open(struct xbps_handle *xhp, const char *url, bool lock)
|
|||||||
/*
|
/*
|
||||||
* Open or create the repository archive.
|
* Open or create the repository archive.
|
||||||
*/
|
*/
|
||||||
|
if (lock)
|
||||||
repo->fd = open(repofile, O_CREAT|O_RDWR, 0664);
|
repo->fd = open(repofile, O_CREAT|O_RDWR, 0664);
|
||||||
|
else
|
||||||
|
repo->fd = open(repofile, O_RDONLY);
|
||||||
|
|
||||||
if (repo->fd == -1) {
|
if (repo->fd == -1) {
|
||||||
xbps_dbg_printf(xhp, "[repo] `%s' open repodata %s\n",
|
xbps_dbg_printf(xhp, "[repo] `%s' open repodata %s\n",
|
||||||
repofile, strerror(errno));
|
repofile, strerror(errno));
|
||||||
|
Loading…
Reference in New Issue
Block a user