- Legitimately skipped files (links) must not cause install-errors.
This has always been broken, but the errors were completely ignored
on install prior to rpm 4.10, and now that we're only creating the
first instance of a shared file, secondary arch multilib packages
with hardlinks were causing install failures because of the "missing"
hardlinks here.
- The relevant part here is obviously the XFA_SKIPPING() test, for
which we need the file states. To keep the lines short, grab the
index to a helper variable and replace other fsm->li->filex[i] uses
with that too.
static int checkHardLinks(FSM_t fsm)
{
int rc = 0;
+ rpmfs fs = fsmGetFs(fsm);
while ((fsm->li = fsm->links) != NULL) {
fsm->links = fsm->li->next;
fsm->li->next = NULL;
if (fsm->li->linksLeft) {
for (nlink_t i = 0 ; i < fsm->li->linksLeft; i++) {
- if (fsm->li->filex[i] < 0)
+ int ix = fsm->li->filex[i];
+ if (ix < 0 || XFA_SKIPPING(rpmfsGetAction(fs, ix)))
continue;
rc = CPIOERR_MISSING_HARDLINK;
if (fsm->failedFile && *fsm->failedFile == NULL) {
- fsm->ix = fsm->li->filex[i];
+ fsm->ix = ix;
if (!fsmMapPath(fsm)) {
/* Out-of-sync hardlinks handled as sub-state */
*fsm->failedFile = fsm->path;