xbps-rindex: fix -a/--add mode repodata archive permissions.

The repodata archive wasn't group writable, resulting in a new archive
created from scratch if the fd wasn't writable.

repodata archives are now created with 0664 mode, this way its main group
also can write to it.
This commit is contained in:
Juan RP
2014-09-15 12:15:42 +02:00
parent 3f7e98235c
commit dee7852af8
3 changed files with 11 additions and 4 deletions

View File

@ -59,6 +59,12 @@ index_add(struct xbps_handle *xhp, int argc, char **argv, bool force)
repodir = dirname(tmprepodir);
repo = xbps_repo_open(xhp, repodir, true);
if (repo == NULL && errno != ENOENT) {
fprintf(stderr, "xbps-rindex: cannot open/lock repository "
"%s: %s\n", repodir, strerror(errno));
rv = -1;
goto out;
}
if (repo && repo->idx) {
xbps_repo_open_idxfiles(repo);
idx = xbps_dictionary_copy(repo->idx);