Verify some properties of replaced and wrong-colored files (RhBug:528383)

- We can't verify any properties of replaced files, but we can and
  should still see if it exists at all.
- Files skipped due to wrong color are supposed to share some of
  the attributes with the file that got actually installed, such
  as permissions and whether it exists at all. Verify what we can
  instead of silently ignoring.
This commit is contained in:
Panu Matilainen 2011-03-09 10:25:29 +02:00
parent 566a15c9c0
commit ee0ae58b44
1 changed files with 12 additions and 2 deletions

View File

@ -70,12 +70,22 @@ int rpmVerifyFile(const rpmts ts, const rpmfi fi,
*/
switch (rpmfiFState(fi)) {
case RPMFILE_STATE_NETSHARED:
case RPMFILE_STATE_REPLACED:
case RPMFILE_STATE_NOTINSTALLED:
case RPMFILE_STATE_WRONGCOLOR:
case RPMFILE_STATE_MISSING:
return 0;
break;
case RPMFILE_STATE_REPLACED:
/* For replaced files we can only verify if it exists at all */
flags = RPMVERIFY_LSTATFAIL;
break;
case RPMFILE_STATE_WRONGCOLOR:
/*
* Files with wrong color are supposed to share some attributes
* with the actually installed file - verify what we can.
*/
flags &= ~(RPMVERIFY_FILEDIGEST | RPMVERIFY_FILESIZE |
RPMVERIFY_MTIME | RPMVERIFY_RDEV);
break;
case RPMFILE_STATE_NORMAL:
break;
}