summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2012-08-17 14:07:05 +0300
committerPanu Matilainen <pmatilai@redhat.com>2012-10-03 10:14:09 +0300
commit914d900c66a2b7dd6efc1c97a9e458d94e5eec26 (patch)
treeceb1a7e78be839d80054be3b360aaa5012b996da
parentec3e946098f779ce7805b1929c4378ba0f7a12c2 (diff)
downloadrpm-914d900c66a2b7dd6efc1c97a9e458d94e5eec26.tar.gz
Only create the first instance of a file shared between packages
- When packages share an identical file, we only need to create the first one we encounter and skip it for the rest (reverse already happens, and must happen, on erase). This has the benefit of getting the timestamp to match the first file, which often is also the last one to get removed. Also when lots of shared files are involved (such as in multilib installations), this can give several percents worth of speed gain as we dont unnecessarily rewrite the same contents over and over. (cherry picked from commit f7f5f88f9f3d6587e747b034ccb64a3f00ff4e1e)
-rw-r--r--lib/transaction.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/transaction.c b/lib/transaction.c
index 9a7e4a283..74ecc4970 100644
--- a/lib/transaction.c
+++ b/lib/transaction.c
@@ -500,6 +500,12 @@ assert(otherFi != NULL);
rpmteNEVRA(otherTe), fn, 0);
free(fn);
}
+ } else {
+ /* Skip create on all but the first instance of a shared file */
+ if (rpmfsGetAction(otherFs, otherFileNum) != FA_UNKNOWN) {
+ rpmfsSetAction(fs, i, FA_SKIP);
+ done = 1;
+ }
}
/* Try to get the disk accounting correct even if a conflict. */