diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2012-08-29 14:31:50 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2012-08-29 14:31:50 +0300 |
commit | 161494b973641175dd5fc9f460e587e0c5d50cbc (patch) | |
tree | 9171f17bc8290621ac6ae3275f1e7d06b2cc6774 /lib/transaction.c | |
parent | 5d4d1507b2eddc56b4d923ac8822f00efcd0a1d5 (diff) | |
download | librpm-tizen-161494b973641175dd5fc9f460e587e0c5d50cbc.tar.gz librpm-tizen-161494b973641175dd5fc9f460e587e0c5d50cbc.tar.bz2 librpm-tizen-161494b973641175dd5fc9f460e587e0c5d50cbc.zip |
Eliminate redundant helper variable
- Just use the file action to determine if we already decided something
for this file or not, no need for additional helper trackers.
Diffstat (limited to 'lib/transaction.c')
-rw-r--r-- | lib/transaction.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/lib/transaction.c b/lib/transaction.c index 469d78d10..fe78bd47f 100644 --- a/lib/transaction.c +++ b/lib/transaction.c @@ -503,9 +503,6 @@ static void handleOverlappedFiles(rpmts ts, rpmFpHash ht, rpmte p, rpmfi fi) switch (rpmteType(p)) { case TR_ADDED: - { - int done = 0; - if (otherPkgNum < 0) { /* XXX is this test still necessary? */ rpmFileAction action; @@ -543,7 +540,6 @@ assert(otherFi != NULL); rpmfsSetAction(fs, i, FA_SKIPCOLOR); rConflicts = 0; } - done = 1; } if (rConflicts && reportConflicts) { char *fn = rpmfiFNIndex(fi, i); @@ -553,10 +549,8 @@ assert(otherFi != NULL); } } else { /* Skip create on all but the first instance of a shared file */ - if (rpmfsGetAction(otherFs, otherFileNum) != FA_UNKNOWN) { + if (rpmfsGetAction(otherFs, otherFileNum) != FA_UNKNOWN) rpmfsSetAction(fs, i, FA_SKIP); - done = 1; - } } /* Skipped files dont need fixup size or backups, %config or not */ @@ -572,10 +566,11 @@ assert(otherFi != NULL); action = (FFlags & RPMFILE_NOREPLACE) ? FA_ALTNAME : FA_SKIP; rpmfsSetAction(fs, i, action); } else { - if (!done) + /* If not decided yet, create it */ + if (rpmfsGetAction(fs, i) == FA_UNKNOWN) rpmfsSetAction(fs, i, FA_CREATE); } - } break; + break; case TR_REMOVED: if (otherPkgNum >= 0) { |