xbps-rindex: dont panic if old binpkg doesn't exist.
This commit is contained in:
parent
25641ec9de
commit
743eabb88e
@ -42,18 +42,18 @@ remove_pkg(const char *repodir, const char *arch, const char *file)
|
|||||||
char *filepath;
|
char *filepath;
|
||||||
int rv;
|
int rv;
|
||||||
|
|
||||||
/* Remove real binpkg */
|
|
||||||
filepath = xbps_xasprintf("%s/%s/%s", repodir, arch, file);
|
filepath = xbps_xasprintf("%s/%s/%s", repodir, arch, file);
|
||||||
if (remove(filepath) == -1) {
|
if (remove(filepath) == -1) {
|
||||||
|
if (errno != ENOENT) {
|
||||||
rv = errno;
|
rv = errno;
|
||||||
xbps_error_printf("failed to remove old binpkg `%s': %s\n",
|
xbps_error_printf("failed to remove old binpkg "
|
||||||
file, strerror(rv));
|
"`%s': %s\n", file, strerror(rv));
|
||||||
free(filepath);
|
free(filepath);
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
free(filepath);
|
free(filepath);
|
||||||
|
|
||||||
/* Remove symlink to binpkg */
|
|
||||||
filepath = xbps_xasprintf("%s/%s", repodir, file);
|
filepath = xbps_xasprintf("%s/%s", repodir, file);
|
||||||
if (remove(filepath) == -1) {
|
if (remove(filepath) == -1) {
|
||||||
rv = errno;
|
rv = errno;
|
||||||
|
Loading…
Reference in New Issue
Block a user