summaryrefslogtreecommitdiff
path: root/rpm2cpio.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2008-05-26 17:19:07 +0300
committerPanu Matilainen <pmatilai@redhat.com>2008-05-26 17:19:07 +0300
commitd7b6c49df211eb775265c79922d608fb285c088f (patch)
treedae316c26841f412e86fb896d9a60f4616f1906d /rpm2cpio.c
parenta9d7285cb0c984e42e0358a3e0d305ecb7d22333 (diff)
downloadlibrpm-tizen-d7b6c49df211eb775265c79922d608fb285c088f.tar.gz
librpm-tizen-d7b6c49df211eb775265c79922d608fb285c088f.tar.bz2
librpm-tizen-d7b6c49df211eb775265c79922d608fb285c088f.zip
Convert rpm2cpio to new headerGet()
Diffstat (limited to 'rpm2cpio.c')
-rw-r--r--rpm2cpio.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/rpm2cpio.c b/rpm2cpio.c
index e5e29331b..6674a722a 100644
--- a/rpm2cpio.c
+++ b/rpm2cpio.c
@@ -67,16 +67,20 @@ int main(int argc, char *argv[])
/* Retrieve type of payload compression. */
{ const char * payload_compressor = NULL;
+ struct rpmtd_s pc;
- if (!headerGetEntry(h, RPMTAG_PAYLOADCOMPRESSOR, NULL,
- (rpm_data_t *) &payload_compressor, NULL))
+ headerGet(h, RPMTAG_PAYLOADCOMPRESSOR, &pc, HEADERGET_DEFAULT);
+ payload_compressor = rpmtdGetString(&pc);
+ if (!payload_compressor)
payload_compressor = "gzip";
+
if (!strcmp(payload_compressor, "gzip"))
rpmio_flags = "r.gzdio";
if (!strcmp(payload_compressor, "bzip2"))
rpmio_flags = "r.bzdio";
if (!strcmp(payload_compressor, "lzma"))
rpmio_flags = "r.lzdio";
+ rpmtdFreeData(&pc);
}
gzdi = Fdopen(fdi, rpmio_flags); /* XXX gzdi == fdi */