Skip to content

Spec parsing

Florian Festi edited this page May 19, 2020 · 1 revision

Notes on Spec parsing

Reading the spec file

  • int readLine(rpmSpec spec, int strip) - get next preprocessed line
    • readLineFromOFI - for filling spec->fileStack->readBuf
      • Closes file and returns to previous one
    • copyNextLineFromOFI - copy from spec->fileStack->readBuf to spec->lbuf, set spec->nextline
      • expandMacrosInSpecBuf
        • parseLineType to detect %if, %else, ...
        • specExpand - if !spec->readStack->reading
          • rpmExpandMacros
    • copyNextLineFinish - set \0 at line break, spec->line = spec->nextline
      • handleComments
    • Handle %if and friends and %include
    • Set line to "" if !spec->readStack->reading
Clone this wiki locally