don't verify files that were never installed (i.e. because of --excludedocs)
authorewt <devnull@localhost>
Wed, 6 Nov 1996 14:37:21 +0000 (14:37 +0000)
committerewt <devnull@localhost>
Wed, 6 Nov 1996 14:37:21 +0000 (14:37 +0000)
CVS patchset: 1150
CVS date: 1996/11/06 14:37:21

lib/verify.c

index c32635f..6553112 100644 (file)
@@ -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))