bin/xbps-rindex/remove-obsoletes.c: also remove pkg signature files.
This commit is contained in:
parent
0a5fa442f2
commit
98748bdcd1
@ -39,23 +39,29 @@
|
|||||||
static int
|
static int
|
||||||
remove_pkg(const char *repodir, const char *file)
|
remove_pkg(const char *repodir, const char *file)
|
||||||
{
|
{
|
||||||
char *filepath;
|
char *filepath, *sigpath;
|
||||||
int rv;
|
int rv = 0;
|
||||||
|
|
||||||
filepath = xbps_xasprintf("%s/%s", repodir, file);
|
filepath = xbps_xasprintf("%s/%s", repodir, file);
|
||||||
|
sigpath = xbps_xasprintf("%s.sig", filepath);
|
||||||
if (remove(filepath) == -1) {
|
if (remove(filepath) == -1) {
|
||||||
if (errno != ENOENT) {
|
if (errno != ENOENT) {
|
||||||
rv = errno;
|
rv = errno;
|
||||||
fprintf(stderr, "xbps-rindex: failed to remove "
|
fprintf(stderr, "xbps-rindex: failed to remove "
|
||||||
"package `%s': %s\n", file,
|
"package `%s': %s\n", file, strerror(rv));
|
||||||
strerror(rv));
|
|
||||||
free(filepath);
|
|
||||||
return rv;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (remove(sigpath) == -1) {
|
||||||
|
if (errno != ENOENT) {
|
||||||
|
rv = errno;
|
||||||
|
fprintf(stderr, "xbps-rindex: failed to remove "
|
||||||
|
"package signature `%s': %s\n", sigpath, strerror(rv));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
free(sigpath);
|
||||||
free(filepath);
|
free(filepath);
|
||||||
|
|
||||||
return 0;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
Loading…
Reference in New Issue
Block a user