From: ewt Date: Wed, 6 Nov 1996 14:37:21 +0000 (+0000) Subject: don't verify files that were never installed (i.e. because of --excludedocs) X-Git-Tag: tznext/4.11.0.1.tizen20130304~10810 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f53478370c87e6678d599cbdfcba6a9fbda3c793;p=tools%2Flibrpm-tizen.git don't verify files that were never installed (i.e. because of --excludedocs) CVS patchset: 1150 CVS date: 1996/11/06 14:37:21 --- 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))