From 5c2acdcdfb756192feeb0f98cc3772484af7ddfa Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Mon, 26 May 2008 14:31:54 +0300 Subject: [PATCH] Convert timeCheck() to new headerGet() & resurrect functionality - it's been broken since forever as it used RPMTAG_OLDFILENAMES but by the time it got called, the filenames had already been compressed so it didn't find anything to check - largely useless but easy to fix, shrug.. --- build/files.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/build/files.c b/build/files.c index 1c34878..3c997ee 100644 --- a/build/files.c +++ b/build/files.c @@ -225,22 +225,21 @@ static char *strtokWithQuotes(char *s, const char *delim) */ static void timeCheck(int tc, Header h) { - HGE_t hge = (HGE_t)headerGetEntryMinMemory; - HFD_t hfd = headerFreeData; rpm_time_t * mtime; - const char ** files; - rpmTagType fnt; - rpm_count_t count, x; time_t currentTime = time(NULL); + struct rpmtd_s files, mtimes; - x = hge(h, RPMTAG_OLDFILENAMES, &fnt, (rpm_data_t *) &files, &count); - x = hge(h, RPMTAG_FILEMTIMES, NULL, (rpm_data_t *) &mtime, NULL); + headerGet(h, RPMTAG_FILENAMES, &files, HEADERGET_EXT); + headerGet(h, RPMTAG_FILEMTIMES, &mtimes, HEADERGET_MINMEM); - for (x = 0; x < count; x++) { - if ((currentTime - mtime[x]) > tc) - rpmlog(RPMLOG_WARNING, _("TIMECHECK failure: %s\n"), files[x]); + while ((mtime = rpmtdNextUint32(&mtimes))) { + if ((currentTime - (time_t) *mtime) > tc) { + rpmlog(RPMLOG_WARNING, _("TIMECHECK failure: %s\n"), + rpmtdGetString(&files)); + } } - files = hfd(files, fnt); + rpmtdFreeData(&files); + rpmtdFreeData(&mtimes); } /** -- 2.7.4