Port parseSimpleScript() to use parseLines(), no functional changes
This commit is contained in:
parent
52ce88851a
commit
783e2dc0b4
|
@ -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:
|
||||
|
||||
|
|
Loading…
Reference in New Issue