diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2013-01-28 12:50:39 +0200 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2013-01-29 08:14:54 +0200 |
commit | 4c41373547becfd03beba8c449dee7d7d2e67870 (patch) | |
tree | 53a4d8627a378f8659e5bff3961d58f6ec02decb /lib/transaction.c | |
parent | 9ca9a5196b2e95e9d650f86a3c6513ea87c8ab8e (diff) | |
download | librpm-tizen-4c41373547becfd03beba8c449dee7d7d2e67870.tar.gz librpm-tizen-4c41373547becfd03beba8c449dee7d7d2e67870.tar.bz2 librpm-tizen-4c41373547becfd03beba8c449dee7d7d2e67870.zip |
Be more careful about skipping shared file/directory creation
- Only skip shared file/dir creation if its actually being created
by another package. Previously we could've decided to skip an entry
where the other file was also being skipped for some other reason.
- Ensure %ghost entries always have FA_SKIP on install, previously
they often were FA_CREATE which makes no sense for %ghost. We dont
encounter %ghosts at all during install in the FSM as they dont
exist in the payload, but the file disposition calculations need
to take them into account now that we're avoiding redundant creates.
- Fixes a regression from commit f7f5f88f9f3d6587e747b034ccb64a3f00ff4e1e
which unearthed the %ghost FA_CREATE issue, reported here:
http://lists.fedoraproject.org/pipermail/buildsys/2013-January/004047.html
(cherry picked from commit a712252392eca75443ca45c10a72873cabec7963)
Diffstat (limited to 'lib/transaction.c')
-rw-r--r-- | lib/transaction.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/transaction.c b/lib/transaction.c index 4cd67207c..1ed1f220b 100644 --- a/lib/transaction.c +++ b/lib/transaction.c @@ -570,7 +570,8 @@ assert(otherFi != NULL); } } else { /* Skip create on all but the first instance of a shared file */ - if (rpmfsGetAction(otherFs, otherFileNum) != FA_UNKNOWN) + rpmFileAction oaction = rpmfsGetAction(otherFs, otherFileNum); + if (oaction != FA_UNKNOWN && !XFA_SKIPPING(oaction)) rpmfsSetAction(fs, i, FA_SKIP); } @@ -758,6 +759,17 @@ static void skipInstallFiles(const rpmts ts, rpmte p) ix = rpmfiDX(fi); drc[ix]++; + /* + * Always skip %ghosts on install. + * XXX: Should we skip directory creation if there are only + * %ghosts in it? Traditionally we create the (empty) directory, so + * preserving that behavior for now at least: leave the refcount alone. + */ + if (rpmfiFFlags(fi) & RPMFILE_GHOST) { + rpmfsSetAction(fs, i, FA_SKIP); + continue; + } + /* Don't bother with skipped files */ if (XFA_SKIPPING(rpmfsGetAction(fs, i))) { drc[ix]--; dff[ix] = 1; |