From 222691ea78781805b36a3712e8a4c28316b79b44 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Sun, 15 Apr 2012 15:41:06 +0200 Subject: [PATCH] Split cleanhtml into cleanhtml() and cleanhtmlPackagesFiles() for late and early cleaning respectively --- src/distromatic.c | 7 ++++++- src/include/reports.h | 1 + src/reports.c | 16 ++++++++++++++-- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/distromatic.c b/src/distromatic.c index 27e807d..1731790 100644 --- a/src/distromatic.c +++ b/src/distromatic.c @@ -1171,6 +1171,12 @@ main(int argc, char *argv[]) if (genheader_mode) { + if (mode & MODE_HTML) { + logmsg(LOG_DEBUG,"cleanHTMLPackagesFiles - start"); + cleanHTMLPackagesFiles(configtag); + logmsg(LOG_DEBUG,"cleanHTMLPackagesFiles - done"); + } + for (i = 0; i < ARCHS_MAX && configtag->arch[i]; i++) { if (!quietmode) @@ -1330,7 +1336,6 @@ main(int argc, char *argv[]) } if (mode & MODE_HTML) { - /* currheaderlist = headerlist; */ logmsg(LOG_DEBUG,"cleanHTMLFiles - start"); cleanHTMLFiles(configtag); logmsg(LOG_DEBUG,"cleanHTMLFiles - done"); diff --git a/src/include/reports.h b/src/include/reports.h index 09777fa..1ba115d 100644 --- a/src/include/reports.h +++ b/src/include/reports.h @@ -21,6 +21,7 @@ int printHTMLWarnings(FILE *fout,struct configTag *configtag, struct headerSourc void printpkgicon(FILE *fout, struct configTag *configtag, struct headerSourceList *s); int generateStats(struct configTag *configtag,int arch); int cleanHTMLFilesInc(char* dir); +int cleanHTMLPackagesFiles(struct configTag *ct); int cleanHTMLFiles(struct configTag *ct); int generateHTMLFiles(struct configTag *configtag,int arch); int generateHTML_SRPMSFiles(struct configTag *configtag); diff --git a/src/reports.c b/src/reports.c index c9331a5..ddf55e0 100644 --- a/src/reports.c +++ b/src/reports.c @@ -1315,16 +1315,28 @@ cleanHTMLFilesInc(char* dir) return 0; } +int +cleanHTMLPackagesFiles(struct configTag *ct) +{ + char dir[PATH_MAX]; + + snprintf(dir,PATH_MAX,"%spackages",ct->html_dir); + if (cleanHTMLFilesInc(dir)) { + logmsg(LOG_WARNING,"cannot clean %s directory",dir); + } + return 0; +} + int cleanHTMLFiles(struct configTag *ct) { int s; char uf[PATH_MAX],dir[PATH_MAX]; - const char* clean_subdir[] = { "", "packages", "maintainers" }; + const char* clean_subdir[] = { "", "maintainers" }; struct headerSourceList *currheadersourcelist; struct stat buf; - for (s = 0; s < 3; s++) { + for (s = 0; s < 2; s++) { snprintf(dir,PATH_MAX,"%s%s",ct->html_dir,clean_subdir[s]); if (cleanHTMLFilesInc(dir)) { logmsg(LOG_WARNING,"cannot clean %s directory",dir);