debug multiline macro expansion.

CVS patchset: 3182
CVS date: 1999/07/19 21:25:53
This commit is contained in:
jbj 1999-07-19 21:25:53 +00:00
parent b499fad538
commit 816ca6b54c
4 changed files with 29 additions and 21 deletions

View File

@ -8,7 +8,7 @@
- add python bindings to rpm-devel (linux only).
- make query (rpm -qvl) behave like (POSIX?) ls for older files (#4050).
- fix: %if parsing skipped 3 chars too many.
- permit multiline macro expansions.
- permit multiline macro expansions with comments and %if.
3.0.1 -> 3.0.2
- eliminate armv4 entries from rpmrc (Andrew E. Mileski).

View File

@ -108,10 +108,11 @@ static int copyNextLine(Spec spec, OFI_t *ofi, int strip)
/* Expand next line from file into line buffer */
if (!(spec->nextline && *spec->nextline)) {
char *from, *to;
to = last = spec->nextline = spec->lbuf;
to = last = spec->lbuf;
from = ofi->readPtr;
while ((ch = *from) && ch != '\n')
*to++ = *from++;
ch = ' ';
while (*from && ch != '\n')
ch = *to++ = *from++;
*to++ = '\0';
ofi->readPtr = from;
@ -119,17 +120,23 @@ static int copyNextLine(Spec spec, OFI_t *ofi, int strip)
rpmError(RPMERR_BADSPEC, _("line %d: %s"), spec->lineNum, spec->lbuf);
return RPMERR_BADSPEC;
}
spec->nextline = spec->lbuf;
}
/* Find next line in expanded line buffer */
spec->line = spec->nextline;
while ((ch = *spec->nextline) && ch != '\n') {
spec->nextline++;
spec->line = last = spec->nextline;
if (spec->line != spec->lbuf)
*spec->line = spec->nextpeekc;
ch = ' ';
while (*spec->nextline && ch != '\n') {
ch = *spec->nextline++;
if (!isspace(ch))
last = spec->nextline;
}
if (ch == '\n')
*spec->nextline++ = '\0';
if (*spec->nextline) {
spec->nextpeekc = *spec->nextline;
*spec->nextline = '\0';
}
if (strip & STRIP_COMMENTS)
handleComments(spec->line);

View File

@ -81,8 +81,9 @@ struct SpecStruct {
/*@owned@*/ struct OpenFileInfo *fileStack;
char lbuf[BUFSIZ];
char *line;
char nextpeekc;
char *nextline;
char *line;
int lineNum;
/*@only@*/ struct ReadLevelEntry *readStack;

View File

@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 1999-07-19 14:32-0400\n"
"POT-Creation-Date: 1999-07-19 17:14-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -1861,49 +1861,49 @@ msgstr ""
msgid "line %d: Second %s"
msgstr ""
#: ../build/parseSpec.c:119
#: ../build/parseSpec.c:120
#, c-format
msgid "line %d: %s"
msgstr ""
#: ../build/parseSpec.c:159
#: ../build/parseSpec.c:166
#, c-format
msgid "Unable to open: %s\n"
msgstr ""
#: ../build/parseSpec.c:171
#: ../build/parseSpec.c:178
msgid "Unclosed %%if"
msgstr ""
#: ../build/parseSpec.c:230
#: ../build/parseSpec.c:237
#, c-format
msgid "%s:%d: parseExpressionBoolean returns %d"
msgstr ""
#. Got an else with no %if !
#: ../build/parseSpec.c:238
#: ../build/parseSpec.c:245
msgid "%s:%d: Got a %%else with no if"
msgstr ""
#. Got an end with no %if !
#: ../build/parseSpec.c:249
#: ../build/parseSpec.c:256
msgid "%s:%d: Got a %%endif with no if"
msgstr ""
#: ../build/parseSpec.c:263 ../build/parseSpec.c:272
#: ../build/parseSpec.c:270 ../build/parseSpec.c:279
msgid "malformed %%include statement"
msgstr ""
#: ../build/parseSpec.c:353
#: ../build/parseSpec.c:360
#, c-format
msgid "Timecheck value must be an integer: %s"
msgstr ""
#: ../build/parseSpec.c:436
#: ../build/parseSpec.c:443
msgid "No buildable architectures"
msgstr ""
#: ../build/parseSpec.c:481
#: ../build/parseSpec.c:488
msgid "Package has no %%description: %s"
msgstr ""