Dont skip shared file/dir create if the other one is a ghost
authorPanu Matilainen <pmatilai@redhat.com>
Wed, 30 Jan 2013 12:07:33 +0000 (14:07 +0200)
committerPanu Matilainen <pmatilai@redhat.com>
Wed, 30 Jan 2013 12:33:20 +0000 (14:33 +0200)
- Explicitly test for shared file/dir being ghost when deciding whether
  to skip create: we must never skip the creation of a real file/dir
  because of a ghost as the ghosts do not get created.
- This fixes the shared ghost testcase, ie the thing that commit
  a712252392eca75443ca45c10a72873cabec7963 was supposed to fix,
  without side-effects that I can see.
(cherry picked from commit 147a26c5f672ee3421fe057725f6be357031bbb5)

lib/transaction.c

index 82d570c62e26f08e8db9d7ea4ba5ca0c8abd8978..9d8dbcf0a9f7a738edbb3ba68bd4499c86b6c43e 100644 (file)
@@ -571,8 +571,14 @@ assert(otherFi != NULL);
            } else {
                /* Skip create on all but the first instance of a shared file */
                rpmFileAction oaction = rpmfsGetAction(otherFs, otherFileNum);
-               if (oaction != FA_UNKNOWN && !XFA_SKIPPING(oaction))
-                   rpmfsSetAction(fs, i, FA_SKIP);
+               if (oaction != FA_UNKNOWN && !XFA_SKIPPING(oaction)) {
+                   rpmfileAttrs oflags;
+                   /* ...but ghosts aren't really created so... */
+                   oflags = rpmfiFFlagsIndex(otherFi, otherFileNum);
+                   if (!(oflags & RPMFILE_GHOST)) {
+                       rpmfsSetAction(fs, i, FA_SKIP);
+                   }
+               }
            }
 
            /* Skipped files dont need fixup size or backups, %config or not */