Filter out skipped files on hardlink checking (RhBug:864622)
authorPanu Matilainen <pmatilai@redhat.com>
Wed, 10 Oct 2012 07:37:34 +0000 (10:37 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Wed, 10 Oct 2012 07:37:34 +0000 (10:37 +0300)
- 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.
- Backported from commit eeea54c76b130da3769ae10f7db2c2fcfb5c57be

lib/fsm.c

index e4ffcaf..4840708 100644 (file)
--- a/lib/fsm.c
+++ b/lib/fsm.c
@@ -1964,12 +1964,14 @@ static int fsmStage(FSM_t fsm, fileStage stage)
            fsm->links = fsm->li->next;
            fsm->li->next = NULL;
            if (fsm->goal == FSM_PKGINSTALL && fsm->li->linksLeft) {
+               rpmfs fs = rpmteGetFileStates(fsmGetTe(fsm));
                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;