summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/psm.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/lib/psm.c b/lib/psm.c
index 26cf0a1e6..783827846 100644
--- a/lib/psm.c
+++ b/lib/psm.c
@@ -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;