From: Panu Matilainen Date: Mon, 26 May 2008 11:31:54 +0000 (+0300) Subject: Convert timeCheck() to new headerGet() & resurrect functionality X-Git-Tag: tznext/4.11.0.1.tizen20130304~4018 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5c2acdcdfb756192feeb0f98cc3772484af7ddfa;p=tools%2Flibrpm-tizen.git 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.. --- 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); } /**