lib/package_alternatives.c: error out if xbps_mkpath() fails.

... and ignore EEXIST for existing dirs.
This commit is contained in:
Juan RP 2015-11-09 16:31:22 +01:00
parent ae8a5dafb8
commit 0fced28044

View File

@ -165,7 +165,16 @@ create_symlinks(struct xbps_handle *xhp, xbps_array_t a, const char *grname)
assert(tgt_dup); assert(tgt_dup);
tgt_dir = dirname(tgt_dup); tgt_dir = dirname(tgt_dup);
tgt = xbps_xasprintf("%s%s", xhp->rootdir, tgt_dir); tgt = xbps_xasprintf("%s%s", xhp->rootdir, tgt_dir);
xbps_mkpath(tgt, 0755); if (xbps_mkpath(tgt, 0755) != 0) {
if (errno != EEXIST) {
xbps_dbg_printf(xhp, "failed to create symlink"
"target dir '%s' for group '%s': %s\n",
tgt, grname, strerror(errno));
free(tgt);
free(l);
return rv;
}
}
free(tgt); free(tgt);
if (l[0] != '/') { if (l[0] != '/') {