xbps_transaction_files: report all conflicting files not just the first.
This commit is contained in:
@ -518,6 +518,7 @@ collect_files(struct xbps_handle *xhp, xbps_dictionary_t d,
|
|||||||
unsigned int i;
|
unsigned int i;
|
||||||
int rv = 0;
|
int rv = 0;
|
||||||
const char *file, *sha256 = NULL;
|
const char *file, *sha256 = NULL;
|
||||||
|
bool error = false;
|
||||||
|
|
||||||
if ((a = xbps_dictionary_get(d, "files"))) {
|
if ((a = xbps_dictionary_get(d, "files"))) {
|
||||||
for (i = 0; i < xbps_array_count(a); i++) {
|
for (i = 0; i < xbps_array_count(a); i++) {
|
||||||
@ -529,8 +530,12 @@ collect_files(struct xbps_handle *xhp, xbps_dictionary_t d,
|
|||||||
xbps_dictionary_get_uint64(filed, "size", &size);
|
xbps_dictionary_get_uint64(filed, "size", &size);
|
||||||
rv = collect_file(xhp, file, size, pkgname, pkgver, idx, sha256,
|
rv = collect_file(xhp, file, size, pkgname, pkgver, idx, sha256,
|
||||||
TYPE_FILE, update, preserve, remove);
|
TYPE_FILE, update, preserve, remove);
|
||||||
if (rv != 0)
|
if (rv == EEXIST) {
|
||||||
|
error = true;
|
||||||
|
continue;
|
||||||
|
} else if (rv != 0) {
|
||||||
goto out;
|
goto out;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((a = xbps_dictionary_get(d, "conf_files"))) {
|
if ((a = xbps_dictionary_get(d, "conf_files"))) {
|
||||||
@ -548,8 +553,12 @@ collect_files(struct xbps_handle *xhp, xbps_dictionary_t d,
|
|||||||
#endif
|
#endif
|
||||||
rv = collect_file(xhp, file, size, pkgname, pkgver, idx, sha256,
|
rv = collect_file(xhp, file, size, pkgname, pkgver, idx, sha256,
|
||||||
TYPE_FILE, update, preserve, remove);
|
TYPE_FILE, update, preserve, remove);
|
||||||
if (rv != 0)
|
if (rv == EEXIST) {
|
||||||
|
error = true;
|
||||||
|
continue;
|
||||||
|
} else if (rv != 0) {
|
||||||
goto out;
|
goto out;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((a = xbps_dictionary_get(d, "links"))) {
|
if ((a = xbps_dictionary_get(d, "links"))) {
|
||||||
@ -558,8 +567,12 @@ collect_files(struct xbps_handle *xhp, xbps_dictionary_t d,
|
|||||||
xbps_dictionary_get_cstring_nocopy(filed, "file", &file);
|
xbps_dictionary_get_cstring_nocopy(filed, "file", &file);
|
||||||
rv = collect_file(xhp, file, 0, pkgname, pkgver, idx, NULL,
|
rv = collect_file(xhp, file, 0, pkgname, pkgver, idx, NULL,
|
||||||
TYPE_LINK, update, preserve, remove);
|
TYPE_LINK, update, preserve, remove);
|
||||||
if (rv != 0)
|
if (rv == EEXIST) {
|
||||||
|
error = true;
|
||||||
|
continue;
|
||||||
|
} else if (rv != 0) {
|
||||||
goto out;
|
goto out;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((a = xbps_dictionary_get(d, "dirs"))) {
|
if ((a = xbps_dictionary_get(d, "dirs"))) {
|
||||||
@ -568,12 +581,19 @@ collect_files(struct xbps_handle *xhp, xbps_dictionary_t d,
|
|||||||
xbps_dictionary_get_cstring_nocopy(filed, "file", &file);
|
xbps_dictionary_get_cstring_nocopy(filed, "file", &file);
|
||||||
rv = collect_file(xhp, file, 0, pkgname, pkgver, idx, NULL,
|
rv = collect_file(xhp, file, 0, pkgname, pkgver, idx, NULL,
|
||||||
TYPE_DIR, update, preserve, remove);
|
TYPE_DIR, update, preserve, remove);
|
||||||
if (rv != 0)
|
if (rv == EEXIST) {
|
||||||
|
error = true;
|
||||||
|
continue;
|
||||||
|
} else if (rv != 0) {
|
||||||
goto out;
|
goto out;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
out:
|
out:
|
||||||
|
if (error)
|
||||||
|
rv = EEXIST;
|
||||||
|
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user