diff options
author | jbj <devnull@localhost> | 2001-10-26 04:16:19 +0000 |
---|---|---|
committer | jbj <devnull@localhost> | 2001-10-26 04:16:19 +0000 |
commit | 4a1a5e81483a2f81b22c3a0d2cb054d93055998e (patch) | |
tree | 13e0de60dd990c9e799bc0975c80741b1b5880de /rpm2cpio.c | |
parent | f03b462b1ef0ad128b7732c0492eefeff9c2248e (diff) | |
download | librpm-tizen-4a1a5e81483a2f81b22c3a0d2cb054d93055998e.tar.gz librpm-tizen-4a1a5e81483a2f81b22c3a0d2cb054d93055998e.tar.bz2 librpm-tizen-4a1a5e81483a2f81b22c3a0d2cb054d93055998e.zip |
- wire transactions through rpmcli install/erase modes.
- legacy signatures always checked on package read.
CVS patchset: 5134
CVS date: 2001/10/26 04:16:19
Diffstat (limited to 'rpm2cpio.c')
-rw-r--r-- | rpm2cpio.c | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/rpm2cpio.c b/rpm2cpio.c index c82d38c67..43025558e 100644 --- a/rpm2cpio.c +++ b/rpm2cpio.c @@ -2,7 +2,11 @@ #include "system.h" -#include "rpmlib.h" +#include <rpmlib.h> +#include <rpmpgp.h> + +#include "depends.c" + #include "debug.h" int main(int argc, char **argv) @@ -10,7 +14,7 @@ int main(int argc, char **argv) FD_t fdi, fdo; Header h; char * rpmio_flags; - int rc, isSource; + rpmRC rc; FD_t gzdi; setprogname(argv[0]); /* Retrofit glibc __progname */ @@ -26,14 +30,33 @@ int main(int argc, char **argv) } fdo = fdDup(STDOUT_FILENO); - rc = rpmReadPackageHeader(fdi, &h, &isSource, NULL, NULL); +#ifdef DYING + rc = rpmReadPackageHeader(fdi, &h, NULL, NULL, NULL); +#else + { const char * rootDir = ""; + rpmdb db = NULL; + rpmTransactionSet ts = rpmtransCreateSet(db, rootDir); + + ts->need_payload = 1; + /*@-mustmod@*/ /* LCL: segfault */ + rc = rpmReadPackageFile(ts, fdi, "rpm2cpio", &h); + /*@=mustmod@*/ + ts->need_payload = 0; + + ts = rpmtransFree(ts); + } +#endif + switch (rc) { - case 0: + case RPMRC_BADSIZE: + case RPMRC_OK: break; - case 1: + case RPMRC_BADMAGIC: fprintf(stderr, _("argument is not an RPM package\n")); exit(EXIT_FAILURE); break; + case RPMRC_FAIL: + case RPMRC_SHORTREAD: default: fprintf(stderr, _("error reading header from package\n")); exit(EXIT_FAILURE); |