diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2008-05-26 17:19:07 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2008-05-26 17:19:07 +0300 |
commit | d7b6c49df211eb775265c79922d608fb285c088f (patch) | |
tree | dae316c26841f412e86fb896d9a60f4616f1906d /rpm2cpio.c | |
parent | a9d7285cb0c984e42e0358a3e0d305ecb7d22333 (diff) | |
download | librpm-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.c | 8 |
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 */ |