|
Panu Matilainen |
3feadd |
commit 104856ea17161eb3a508913c2b7ed701f2e4f6aa
|
|
Panu Matilainen |
3feadd |
Author: Panu Matilainen <pmatilai@redhat.com>
|
|
Panu Matilainen |
3feadd |
Date: Tue Oct 7 15:37:21 2014 +0300
|
|
Panu Matilainen |
3feadd |
|
|
Panu Matilainen |
3feadd |
Unbreak size and archive size generation on big-endian systems
|
|
Panu Matilainen |
3feadd |
|
|
Panu Matilainen |
3feadd |
- Fix regression from commit 68bddc353a7ea87ea00ad957858cd509e845e84c,
|
|
Panu Matilainen |
3feadd |
accessing a 64bit int as if it were a 32bit one doesn't make it one.
|
|
Panu Matilainen |
3feadd |
|
|
Panu Matilainen |
3feadd |
diff --git a/build/pack.c b/build/pack.c
|
|
Panu Matilainen |
3feadd |
index 28834dc..15f005a 100644
|
|
Panu Matilainen |
3feadd |
--- a/build/pack.c
|
|
Panu Matilainen |
3feadd |
+++ b/build/pack.c
|
|
Panu Matilainen |
3feadd |
@@ -273,9 +273,6 @@ static rpmRC generateSignature(char *SHA1, uint8_t *MD5, rpm_loff_t size,
|
|
Panu Matilainen |
3feadd |
{
|
|
Panu Matilainen |
3feadd |
Header sig = NULL;
|
|
Panu Matilainen |
3feadd |
struct rpmtd_s td;
|
|
Panu Matilainen |
3feadd |
- rpmTagVal sizetag;
|
|
Panu Matilainen |
3feadd |
- rpmTagVal payloadtag;
|
|
Panu Matilainen |
3feadd |
- rpm_tagtype_t typetag;
|
|
Panu Matilainen |
3feadd |
rpmRC rc = RPMRC_OK;
|
|
Panu Matilainen |
3feadd |
char *reservedSpace;
|
|
Panu Matilainen |
3feadd |
int spaceSize = 0;
|
|
Panu Matilainen |
3feadd |
@@ -297,29 +294,33 @@ static rpmRC generateSignature(char *SHA1, uint8_t *MD5, rpm_loff_t size,
|
|
Panu Matilainen |
3feadd |
td.data = MD5;
|
|
Panu Matilainen |
3feadd |
headerPut(sig, &td, HEADERPUT_DEFAULT);
|
|
Panu Matilainen |
3feadd |
|
|
Panu Matilainen |
3feadd |
+ rpmtdReset(&td);
|
|
Panu Matilainen |
3feadd |
+ td.count = 1;
|
|
Panu Matilainen |
3feadd |
if (payloadSize < UINT32_MAX) {
|
|
Panu Matilainen |
3feadd |
- sizetag = RPMSIGTAG_SIZE;
|
|
Panu Matilainen |
3feadd |
- payloadtag = RPMSIGTAG_PAYLOADSIZE;
|
|
Panu Matilainen |
3feadd |
- typetag = RPM_INT32_TYPE;
|
|
Panu Matilainen |
3feadd |
+ rpm_off_t p = payloadSize;
|
|
Panu Matilainen |
3feadd |
+ rpm_off_t s = size;
|
|
Panu Matilainen |
3feadd |
+ td.type = RPM_INT32_TYPE;
|
|
Panu Matilainen |
3feadd |
+
|
|
Panu Matilainen |
3feadd |
+ td.tag = RPMSIGTAG_PAYLOADSIZE;
|
|
Panu Matilainen |
3feadd |
+ td.data = &p;
|
|
Panu Matilainen |
3feadd |
+ headerPut(sig, &td, HEADERPUT_DEFAULT);
|
|
Panu Matilainen |
3feadd |
+
|
|
Panu Matilainen |
3feadd |
+ td.tag = RPMSIGTAG_SIZE;
|
|
Panu Matilainen |
3feadd |
+ td.data = &s;
|
|
Panu Matilainen |
3feadd |
+ headerPut(sig, &td, HEADERPUT_DEFAULT);
|
|
Panu Matilainen |
3feadd |
} else {
|
|
Panu Matilainen |
3feadd |
- sizetag = RPMSIGTAG_LONGSIZE;
|
|
Panu Matilainen |
3feadd |
- payloadtag = RPMSIGTAG_LONGARCHIVESIZE;
|
|
Panu Matilainen |
3feadd |
- typetag = RPM_INT64_TYPE;
|
|
Panu Matilainen |
3feadd |
- }
|
|
Panu Matilainen |
3feadd |
+ rpm_loff_t p = payloadSize;
|
|
Panu Matilainen |
3feadd |
+ rpm_loff_t s = size;
|
|
Panu Matilainen |
3feadd |
+ td.type = RPM_INT64_TYPE;
|
|
Panu Matilainen |
3feadd |
|
|
Panu Matilainen |
3feadd |
- rpmtdReset(&td);
|
|
Panu Matilainen |
3feadd |
- td.tag = payloadtag;
|
|
Panu Matilainen |
3feadd |
- td.count = 1;
|
|
Panu Matilainen |
3feadd |
- td.type = typetag;
|
|
Panu Matilainen |
3feadd |
- td.data = &payloadSize;
|
|
Panu Matilainen |
3feadd |
- headerPut(sig, &td, HEADERPUT_DEFAULT);
|
|
Panu Matilainen |
3feadd |
+ td.tag = RPMSIGTAG_LONGARCHIVESIZE;
|
|
Panu Matilainen |
3feadd |
+ td.data = &p;
|
|
Panu Matilainen |
3feadd |
+ headerPut(sig, &td, HEADERPUT_DEFAULT);
|
|
Panu Matilainen |
3feadd |
|
|
Panu Matilainen |
3feadd |
- rpmtdReset(&td);
|
|
Panu Matilainen |
3feadd |
- td.tag = sizetag;
|
|
Panu Matilainen |
3feadd |
- td.count = 1;
|
|
Panu Matilainen |
3feadd |
- td.type = typetag;
|
|
Panu Matilainen |
3feadd |
- td.data = &siz;;
|
|
Panu Matilainen |
3feadd |
- headerPut(sig, &td, HEADERPUT_DEFAULT);
|
|
Panu Matilainen |
3feadd |
+ td.tag = RPMSIGTAG_LONGSIZE;
|
|
Panu Matilainen |
3feadd |
+ td.data = &s;
|
|
Panu Matilainen |
3feadd |
+ headerPut(sig, &td, HEADERPUT_DEFAULT);
|
|
Panu Matilainen |
3feadd |
+ }
|
|
Panu Matilainen |
3feadd |
|
|
Panu Matilainen |
3feadd |
spaceSize = rpmExpandNumeric("%{__gpg_reserved_space}");
|
|
Panu Matilainen |
3feadd |
if(spaceSize > 0) {
|