diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2008-11-15 18:44:00 +0200 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2008-11-17 14:20:21 +0200 |
commit | 4181d7adadecf64102e620a23a697c756e3602c9 (patch) | |
tree | 1dedca6896a1f11c9a828bd8f2e9f977e8edc30c /lib/psm.c | |
parent | 899dfb58927ec6e91014773430824462f4d0002e (diff) | |
download | rpm-4181d7adadecf64102e620a23a697c756e3602c9.tar.gz rpm-4181d7adadecf64102e620a23a697c756e3602c9.tar.bz2 rpm-4181d7adadecf64102e620a23a697c756e3602c9.zip |
Assume failure in rpmInstallSourcePackage()
- avoids bunch of redundant assignments
Diffstat (limited to 'lib/psm.c')
-rw-r--r-- | lib/psm.c | 13 |
1 files changed, 3 insertions, 10 deletions
@@ -249,18 +249,16 @@ rpmRC rpmInstallSourcePackage(rpmts ts, FD_t fd, if (h == NULL) goto exit; - rpmrc = RPMRC_OK; + rpmrc = RPMRC_FAIL; /* assume failure */ isSource = headerIsSource(h); if (!isSource) { rpmlog(RPMLOG_ERR, _("source package expected, binary found\n")); - rpmrc = RPMRC_FAIL; goto exit; } if (rpmtsAddInstallElement(ts, h, NULL, 0, NULL)) { - rpmrc = RPMRC_FAIL; goto exit; } @@ -268,13 +266,11 @@ rpmRC rpmInstallSourcePackage(rpmts ts, FD_t fd, h = headerFree(h); if (fi == NULL) { /* XXX can't happen */ - rpmrc = RPMRC_FAIL; goto exit; } fi->te = rpmtsElement(ts, 0); if (fi->te == NULL) { /* XXX can't happen */ - rpmrc = RPMRC_FAIL; goto exit; } @@ -312,7 +308,6 @@ rpmRC rpmInstallSourcePackage(rpmts ts, FD_t fd, } if (rpmMkdirs(rpmtsRootDir(ts), "%{_topdir}:%{_sourcedir}:%{_specdir}")) { - rpmrc = RPMRC_FAIL; goto exit; } /* Build dnl/dil with {_sourcedir, _specdir} as values. */ @@ -344,7 +339,6 @@ rpmRC rpmInstallSourcePackage(rpmts ts, FD_t fd, free(_sourcedir); } else { rpmlog(RPMLOG_ERR, _("source package contains no .spec file\n")); - rpmrc = RPMRC_FAIL; goto exit; } @@ -352,12 +346,11 @@ rpmRC rpmInstallSourcePackage(rpmts ts, FD_t fd, psm->goal = PSM_PKGINSTALL; /* FIX: psm->fi->dnl should be owned. */ - rpmrc = rpmpsmStage(psm, PSM_PROCESS); + if (rpmpsmStage(psm, PSM_PROCESS) == RPMRC_OK) + rpmrc = RPMRC_OK; (void) rpmpsmStage(psm, PSM_FINI); - if (rpmrc) rpmrc = RPMRC_FAIL; - exit: if (specFilePtr && specFile && rpmrc == RPMRC_OK) *specFilePtr = specFile; |