summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2012-01-28 14:50:16 +0200
committerPanu Matilainen <pmatilai@redhat.com>2012-01-28 14:50:16 +0200
commit0b65068823cb97107999cda3b3e3c2cd6628c073 (patch)
tree2575162bab5bb14b2cc830426e0c0ac8397ebd4b
parent45f6af7b2b6f563cdfc825ae359973290c04adab (diff)
downloadlibrpm-tizen-0b65068823cb97107999cda3b3e3c2cd6628c073.tar.gz
librpm-tizen-0b65068823cb97107999cda3b3e3c2cd6628c073.tar.bz2
librpm-tizen-0b65068823cb97107999cda3b3e3c2cd6628c073.zip
Move TR_ADDED file size init into addTE()
- No functional changes, just stuffing it there along with most other rpmte init work and remove the pointless switch-case while at it
-rw-r--r--lib/rpmte.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/rpmte.c b/lib/rpmte.c
index 5b5d2ad1e..f8ffd4dbd 100644
--- a/lib/rpmte.c
+++ b/lib/rpmte.c
@@ -262,6 +262,10 @@ static void addTE(rpmte p, Header h, fnpyKey key, rpmRelocation * relocs)
rpmteColorDS(p, RPMTAG_PROVIDENAME);
rpmteColorDS(p, RPMTAG_REQUIRENAME);
+
+ if (p->type == TR_ADDED)
+ p->pkgFileSize = headerGetNumber(h, RPMTAG_LONGSIGSIZE) + 96 + 256;
+
return;
}
@@ -310,14 +314,6 @@ rpmte rpmteNew(rpmts ts, Header h, rpmElementType type, fnpyKey key,
p->ts = ts;
p->type = type;
addTE(p, h, key, relocs);
- switch (type) {
- case TR_ADDED:
- p->pkgFileSize = headerGetNumber(h, RPMTAG_LONGSIGSIZE) + 96 + 256;
- break;
- case TR_REMOVED:
- /* nothing to do */
- break;
- }
return p;
}