- /* Retrieve type of payload compression. */
- { const char * payload_compressor = NULL;
- char * t;
-
- if (!headerGetEntry(h, RPMTAG_PAYLOADCOMPRESSOR, NULL,
- (void **) &payload_compressor, NULL))
- payload_compressor = "gzip";
- rpmio_flags = t = alloca(sizeof("r.gzdio"));
- *t++ = 'r';
- if (!strcmp(payload_compressor, "gzip"))
- t = stpcpy(t, ".gzdio");
- if (!strcmp(payload_compressor, "bzip2"))
- t = stpcpy(t, ".bzdio");
+ /* Retrieve payload size and compression type. */
+ { const char *compr = headerGetString(h, RPMTAG_PAYLOADCOMPRESSOR);
+ rpmio_flags = rstrscat(NULL, "r.", compr ? compr : "gzip", NULL);
+ payload_size = headerGetNumber(h, RPMTAG_LONGARCHIVESIZE);