diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2007-12-01 21:06:00 +0200 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2007-12-01 21:06:00 +0200 |
commit | fb90b8b4eb46c4008326e07b4866f4bf0875df83 (patch) | |
tree | cc65f32a0cafaf9efec3c82cc77a71dc9a51913c /tools | |
parent | c4f116eec34eb283d37dca84b6a38c9fb38537e5 (diff) | |
download | rpm-fb90b8b4eb46c4008326e07b4866f4bf0875df83.tar.gz rpm-fb90b8b4eb46c4008326e07b4866f4bf0875df83.tar.bz2 rpm-fb90b8b4eb46c4008326e07b4866f4bf0875df83.zip |
More rpmlead exorcizing
- remove unnecessary type parameter to writeRPM(), header knows what it is
- remove unnecessary lead argument to readRPM(), it's unused anyway
- drop lead from cpioSourceArchive struct
Diffstat (limited to 'tools')
-rw-r--r-- | tools/rpminject.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/tools/rpminject.c b/tools/rpminject.c index a13143faa..3d806c746 100644 --- a/tools/rpminject.c +++ b/tools/rpminject.c @@ -367,7 +367,6 @@ headerInject(Header *hdrp, cmd_t *cmds[], int ncmds) static int rewriteRPM(const char *fni, const char *fno, cmd_t *cmds[], int ncmds) { - struct rpmlead lead; /* XXX FIXME: exorcize lead/arch/os */ Header sigs; rpmSpec spec; struct cpioSourceArchive_s csabuf, *csa = &csabuf; @@ -376,10 +375,9 @@ rewriteRPM(const char *fni, const char *fno, cmd_t *cmds[], int ncmds) csa->cpioArchiveSize = 0; csa->cpioFdIn = fdNew("init (rewriteRPM)"); csa->cpioList = NULL; - csa->lead = &lead; /* XXX FIXME: exorcize lead/arch/os */ /* Read rpm and (partially) recreate spec/pkg control structures */ - if ((rc = readRPM(fni, &spec, &lead, &sigs, csa)) != 0) + if ((rc = readRPM(fni, &spec, &sigs, csa)) != 0) return rc; /* Inject new strings into header tags */ @@ -387,11 +385,11 @@ rewriteRPM(const char *fni, const char *fno, cmd_t *cmds[], int ncmds) goto exit; /* Rewrite the rpm */ - if (lead.type == RPMLEAD_SOURCE) { - rc = writeRPM(&spec->packages->header, NULL, fno, (int)lead.type, + if (headerIsSource(spec->packages->header)) { + rc = writeRPM(&spec->packages->header, NULL, fno, csa, spec->passPhrase, &(spec->cookie)); } else { - rc = writeRPM(&spec->packages->header, NULL, fno, (int)lead.type, + rc = writeRPM(&spec->packages->header, NULL, fno, csa, spec->passPhrase, NULL); } |