Port parseSimpleScript() to use parseLines(), no functional changes

This commit is contained in:
Panu Matilainen 2019-04-17 13:48:54 +03:00 committed by Florian Festi
parent 52ce88851a
commit 783e2dc0b4
1 changed files with 2 additions and 20 deletions

View File

@ -11,7 +11,7 @@
int parseSimpleScript(rpmSpec spec, const char * name, StringBuf *sbp)
{
int nextPart, rc, res = PART_ERROR;
int res = PART_ERROR;
if (*sbp != NULL) {
rpmlog(RPMLOG_ERR, _("line %d: second %s\n"),
@ -19,26 +19,8 @@ int parseSimpleScript(rpmSpec spec, const char * name, StringBuf *sbp)
goto exit;
}
*sbp = newStringBuf();
/* There are no options to %build, %install, %check, or %clean */
if ((rc = readLine(spec, STRIP_NOTHING)) > 0) {
res = PART_NONE;
goto exit;
} else if (rc < 0) {
goto exit;
}
while (! (nextPart = isPart(spec->line))) {
appendStringBuf(*sbp, spec->line);
if ((rc = readLine(spec, STRIP_NOTHING)) > 0) {
nextPart = PART_NONE;
break;
} else if (rc < 0) {
goto exit;
}
}
res = nextPart;
res = parseLines(spec, STRIP_NOTHING, NULL, sbp);
exit: