From 98748bdcd16e9a7dd1bdb5005ea5f226a210152f Mon Sep 17 00:00:00 2001 From: Juan RP Date: Tue, 24 Dec 2013 12:02:33 +0100 Subject: [PATCH] bin/xbps-rindex/remove-obsoletes.c: also remove pkg signature files. --- bin/xbps-rindex/remove-obsoletes.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/bin/xbps-rindex/remove-obsoletes.c b/bin/xbps-rindex/remove-obsoletes.c index 264fde8b..0c1f222d 100644 --- a/bin/xbps-rindex/remove-obsoletes.c +++ b/bin/xbps-rindex/remove-obsoletes.c @@ -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