xbps-rindex(8): fix crash in -r when a pkg cannot be removed.
This commit is contained in:
parent
fa40928026
commit
82a8263f37
5
NEWS
5
NEWS
@ -1,6 +1,9 @@
|
|||||||
xbps-0.20 (???):
|
xbps-0.20 (???):
|
||||||
|
|
||||||
* xbps-install: don't treat EEXIST as an error when installing
|
* xbps-rindex(8): fix crash in -r (remove-obsoletes mode) if pkg cannot
|
||||||
|
be removed (permissions or file disappeared).
|
||||||
|
|
||||||
|
* xbps-install(8): don't treat EEXIST as an error when installing
|
||||||
new packages; technically it's not an error.
|
new packages; technically it's not an error.
|
||||||
|
|
||||||
* libfetch: added a patch to fix select(2) timing out when fetching
|
* libfetch: added a patch to fix select(2) timing out when fetching
|
||||||
|
@ -56,8 +56,9 @@ remove_pkg(const char *repodir, const char *arch, const char *file)
|
|||||||
if (remove(filepath) == -1) {
|
if (remove(filepath) == -1) {
|
||||||
if (errno != ENOENT) {
|
if (errno != ENOENT) {
|
||||||
rv = errno;
|
rv = errno;
|
||||||
xbps_error_printf("failed to remove old binpkg "
|
fprintf(stderr, "xbps-rindex: failed to remove "
|
||||||
"`%s': %s\n", file, strerror(rv));
|
"package `%s': %s\n", file,
|
||||||
|
strerror(rv));
|
||||||
free(filepath);
|
free(filepath);
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
@ -68,8 +69,9 @@ remove_pkg(const char *repodir, const char *arch, const char *file)
|
|||||||
if (remove(filepath) == -1) {
|
if (remove(filepath) == -1) {
|
||||||
if (errno != ENOENT) {
|
if (errno != ENOENT) {
|
||||||
rv = errno;
|
rv = errno;
|
||||||
xbps_error_printf("failed to remove old binpkg "
|
fprintf(stderr, "xbps-rindex: failed to remove "
|
||||||
"`%s': %s\n", file, strerror(rv));
|
"package `%s': %s\n", file,
|
||||||
|
strerror(rv));
|
||||||
free(filepath);
|
free(filepath);
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
@ -95,11 +97,8 @@ cleaner_thread(void *arg)
|
|||||||
if (pkgd == NULL) {
|
if (pkgd == NULL) {
|
||||||
rv = remove_pkg(thd->ri->uri, arch, binpkg);
|
rv = remove_pkg(thd->ri->uri, arch, binpkg);
|
||||||
if (rv != 0) {
|
if (rv != 0) {
|
||||||
fprintf(stderr, "xbps-rindex: failed to remove "
|
|
||||||
"package `%s': %s\n", binpkg,
|
|
||||||
strerror(rv));
|
|
||||||
prop_object_release(pkgd);
|
prop_object_release(pkgd);
|
||||||
break;
|
continue;
|
||||||
}
|
}
|
||||||
printf("Removed broken package `%s'.\n", binpkg);
|
printf("Removed broken package `%s'.\n", binpkg);
|
||||||
}
|
}
|
||||||
@ -118,10 +117,8 @@ cleaner_thread(void *arg)
|
|||||||
if (!xbps_rindex_get_pkg(thd->ri, pkgver)) {
|
if (!xbps_rindex_get_pkg(thd->ri, pkgver)) {
|
||||||
rv = remove_pkg(thd->ri->uri, arch, binpkg);
|
rv = remove_pkg(thd->ri->uri, arch, binpkg);
|
||||||
if (rv != 0) {
|
if (rv != 0) {
|
||||||
fprintf(stderr, "xbps-rindex: failed to remove "
|
|
||||||
"package `%s': %s\n", binpkg,
|
|
||||||
strerror(rv));
|
|
||||||
prop_object_release(pkgd);
|
prop_object_release(pkgd);
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
printf("Removed obsolete package `%s'.\n", binpkg);
|
printf("Removed obsolete package `%s'.\n", binpkg);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user