}
/**
- * Mark files in database shared with this package as "replaced".
+ * Adjust file states in database for files shared with this package:
+ * currently either "replaced" or "wrong color".
* @param psm package state machine data
* @return 0 always
*/
assert(ix != -1);
char *state = rpmtdGetChar(&secStates);
- if (state && *state != RPMFILE_STATE_REPLACED) {
- *state = RPMFILE_STATE_REPLACED;
+ if (state && *state != sfi->rstate) {
+ *state = sfi->rstate;
if (modified == 0) {
/* Modified header will be rewritten. */
modified = 1;
return (fs != NULL) ? fs->fc : 0;
}
-void rpmfsAddReplaced(rpmfs fs, int pkgFileNum, int otherPkg, int otherFileNum)
+void rpmfsAddReplaced(rpmfs fs, int pkgFileNum, char rstate,
+ int otherPkg, int otherFileNum)
{
if (!fs->replaced) {
fs->replaced = xcalloc(3, sizeof(*fs->replaced));
fs->replaced = xrealloc(fs->replaced, fs->allocatedReplaced*sizeof(*fs->replaced));
}
fs->replaced[fs->numReplaced].pkgFileNum = pkgFileNum;
+ fs->replaced[fs->numReplaced].rstate = rstate;
fs->replaced[fs->numReplaced].otherPkg = otherPkg;
fs->replaced[fs->numReplaced].otherFileNum = otherFileNum;
int pkgFileNum;
int otherPkg;
int otherFileNum;
+ char rstate;
};
#ifdef __cplusplus
rpm_count_t rpmfsFC(rpmfs fs);
RPM_GNUC_INTERNAL
-void rpmfsAddReplaced(rpmfs fs, int pkgFileNum, int otherPkg, int otherFileNum);
+void rpmfsAddReplaced(rpmfs fs, int pkgFileNum, char rstate,
+ int otherPkg, int otherFileNum);
RPM_GNUC_INTERNAL
sharedFileInfo rpmfsGetReplaced(rpmfs fs);
rpm_color_t FColor = rpmfiFColor(fi) & tscolor;
rpm_color_t oFColor = rpmfiFColor(otherFi) & tscolor;
int rConflicts;
+ char rState = RPMFILE_STATE_REPLACED;
rConflicts = !(beingRemoved || (rpmtsFilterFlags(ts) & RPMPROB_FILTER_REPLACEOLDFILES));
/* Resolve file conflicts to prefer Elf64 (if not forced). */
} else if (FColor & prefcolor) {
rpmfsSetAction(fs, fx, FA_CREATE);
rConflicts = 0;
+ rState = RPMFILE_STATE_WRONGCOLOR;
}
}
/* Save file identifier to mark as state REPLACED. */
if ( !(isCfgFile || XFA_SKIPPING(rpmfsGetAction(fs, fx))) ) {
if (!beingRemoved)
- rpmfsAddReplaced(rpmteGetFileStates(p), rpmfiFX(fi),
+ rpmfsAddReplaced(rpmteGetFileStates(p), rpmfiFX(fi), rState,
headerGetInstance(otherHeader),
rpmfiFX(otherFi));
}