build/parsePrep.c: add %patch -F<N> support (ALT#27662)

In modern rpms both %patch -F <N> and %patch -F<N> are valid option
calls whereas old -F implementation supported -F <N> syntax only.
This patch adds support for %patch -F<N> syntax.
This commit is contained in:
Igor Vlasenko 2012-08-24 11:30:44 +03:00 committed by Dmitry V. Levin
parent f83f47f6f1
commit 8468c6fb06

View File

@ -533,13 +533,18 @@ static int doPatchMacro(Spec spec, char *line)
spec->lineNum, spec->line); spec->lineNum, spec->line);
return RPMERR_BADSPEC; return RPMERR_BADSPEC;
} }
} else if (!strcmp(s, "-F")) { } else if (!strncmp(s, "-F", sizeof("-F")-1)) {
s = strtok(NULL, " \t\n"); /* unfortunately, we must support -FX */
if (s == NULL) { if (! strchr(" \t\n", s[2])) {
rpmError(RPMERR_BADSPEC, s = s + 2;
_("line %d: Need arg to %%patch -F: %s\n"), } else {
spec->lineNum, spec->line); s = strtok(NULL, " \t\n");
return RPMERR_BADSPEC; if (s == NULL) {
rpmError(RPMERR_BADSPEC,
_("line %d: Need arg to %%patch -F: %s\n"),
spec->lineNum, spec->line);
return RPMERR_BADSPEC;
}
} }
if (parseNum(s, &opt_F)) { if (parseNum(s, &opt_F)) {
rpmError(RPMERR_BADSPEC, rpmError(RPMERR_BADSPEC,