diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2008-11-15 17:55:47 +0200 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2008-11-15 17:55:47 +0200 |
commit | 4fa662abd1d1f5b5f155a734d0e87aa7e7894ae3 (patch) | |
tree | 683000fd0c83068f4e35145a10863e39837543d2 /lib/psm.c | |
parent | 170f5bf7d6ce45142cb750d732a625c168c3f524 (diff) | |
download | rpm-4fa662abd1d1f5b5f155a734d0e87aa7e7894ae3.tar.gz rpm-4fa662abd1d1f5b5f155a734d0e87aa7e7894ae3.tar.bz2 rpm-4fa662abd1d1f5b5f155a734d0e87aa7e7894ae3.zip |
Use rpmpsmNew() + rpmpsmFree() instead of manually doing the same
Diffstat (limited to 'lib/psm.c')
-rw-r--r-- | lib/psm.c | 18 |
1 files changed, 4 insertions, 14 deletions
@@ -231,15 +231,11 @@ rpmRC rpmInstallSourcePackage(rpmts ts, FD_t fd, rpmfi fi = NULL; char * specFile = NULL; Header h = NULL; - struct rpmpsm_s psmbuf; - rpmpsm psm = &psmbuf; + rpmpsm psm = NULL; int isSource; rpmRC rpmrc; int i; - memset(psm, 0, sizeof(*psm)); - psm->ts = rpmtsLink(ts, RPMDBG_M("InstallSourcePackage")); - rpmrc = rpmReadPackageFile(ts, fd, RPMDBG_M("InstallSourcePackage"), &h); switch (rpmrc) { case RPMRC_NOTTRUSTED: @@ -284,11 +280,7 @@ rpmRC rpmInstallSourcePackage(rpmts ts, FD_t fd, rpmteSetHeader(fi->te, fi->h); fi->te->fd = fdLink(fd, RPMDBG_M("installSourcePackage")); - -(void) rpmInstallLoadMacros(fi, fi->h); - - psm->fi = rpmfiLink(fi, RPMDBG_M("rpmInstallLoadMacros")); - psm->te = fi->te; + (void) rpmInstallLoadMacros(fi, fi->h); if (cookie) { struct rpmtd_s ctd; @@ -356,6 +348,7 @@ rpmRC rpmInstallSourcePackage(rpmts ts, FD_t fd, goto exit; } + psm = rpmpsmNew(ts, fi->te, fi); psm->goal = PSM_PKGINSTALL; /* FIX: psm->fi->dnl should be owned. */ @@ -371,9 +364,6 @@ exit: else specFile = _free(specFile); - psm->fi = rpmfiFree(psm->fi); - psm->te = NULL; - if (h != NULL) h = headerFree(h); if (fi != NULL) { @@ -388,7 +378,7 @@ exit: /* XXX nuke the added package(s). */ rpmtsClean(ts); - psm->ts = rpmtsFree(psm->ts); + psm = rpmpsmFree(psm); return rpmrc; } |