From: Panu Matilainen Date: Wed, 9 Mar 2011 08:25:29 +0000 (+0200) Subject: Verify some properties of replaced and wrong-colored files (RhBug:528383) X-Git-Tag: tznext/4.11.0.1.tizen20130304~1284 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ee0ae58b442c5f79967a0d0580144b5c84e0c888;p=tools%2Flibrpm-tizen.git 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. --- diff --git a/lib/verify.c b/lib/verify.c index 3be357d..46210bc 100644 --- a/lib/verify.c +++ b/lib/verify.c @@ -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; }