bin/xbps-rindex/remove-obsoletes.c: also remove pkg signature files.

This commit is contained in:
Juan RP 2013-12-24 12:02:33 +01:00
parent 0a5fa442f2
commit 98748bdcd1

View File

@ -39,23 +39,29 @@
static int
remove_pkg(const char *repodir, const char *file)
{
char *filepath;
int rv;
char *filepath, *sigpath;
int rv = 0;
filepath = xbps_xasprintf("%s/%s", repodir, file);
sigpath = xbps_xasprintf("%s.sig", filepath);
if (remove(filepath) == -1) {
if (errno != ENOENT) {
rv = errno;
fprintf(stderr, "xbps-rindex: failed to remove "
"package `%s': %s\n", file,
strerror(rv));
free(filepath);
return rv;
"package `%s': %s\n", file, strerror(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);
return 0;
return rv;
}
static int