From f53478370c87e6678d599cbdfcba6a9fbda3c793 Mon Sep 17 00:00:00 2001 From: ewt Date: Wed, 6 Nov 1996 14:37:21 +0000 Subject: [PATCH] don't verify files that were never installed (i.e. because of --excludedocs) CVS patchset: 1150 CVS date: 1996/11/06 14:37:21 --- lib/verify.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/verify.c b/lib/verify.c index c32635f..6553112 100644 --- a/lib/verify.c +++ b/lib/verify.c @@ -16,6 +16,7 @@ int rpmVerifyFile(char * prefix, Header h, int filenum, int * result) { int_32 * verifyFlags, flags; int_32 * sizeList, * mtimeList; unsigned short * modeList, * rdevList; + char * fileStatesList; char * filespec; int type, count, rc; struct stat sb; @@ -47,11 +48,18 @@ int rpmVerifyFile(char * prefix, Header h, int filenum, int * result) { free(fileList); + *result = 0; + + /* Check to see if the file was installed - if not pretend all is OK */ + if (getEntry(h, RPMTAG_FILESTATES, &type, + (void **) &fileStatesList, &count) && fileStatesList) { + if (fileStatesList[filenum] == RPMFILE_STATE_NOTINSTALLED) + return 0; + } + if (lstat(filespec, &sb)) return 1; - *result = 0; - if (S_ISDIR(sb.st_mode)) flags &= ~(VERIFY_MD5 | VERIFY_FILESIZE | VERIFY_MTIME | VERIFY_LINKTO); else if (S_ISLNK(sb.st_mode)) -- 2.7.4