syntax: spec: add some keywords that were added in RPM 4.15 and 4.13
In RPM 4.15, a number of new spec section features were introduced: * %dnl - macro-engine level comments * %elif, %elifos, %elifarch - 'else if' stanzas for conditionals * %sourcelist - section for listing sources line by line * %patchlist - section for listing patches line by line * %generate_buildrequires - script section after %prep for generating build dependencies (Reference: https://rpm.org/wiki/Releases/4.15.0.html.) An enhancement added in RPM 4.13: * Sections for file trigger stanzas (Reference: https://rpm.org/user_doc/file_triggers.html.) As these are being increasingly used in Fedora and other distributions, it's quite helpful to have syntax highlighting be up to date on handling them. Signed-off-by: Neal Gompa <ngompa13@gmail.com>master
parent
c802f91f4e
commit
ad52830fb8
|
@ -15,9 +15,9 @@ color brightblue start="^Source" end=":" start="^Patch" end=":"
|
||||||
# Architectures.
|
# Architectures.
|
||||||
color brightred "(i386|i486|i586|i686|athlon|ia64|alpha|alphaev5|alphaev56|alphapca56|alphaev6|alphaev67|sparc|sparcv9|sparc64armv3l|armv4b|armv4lm|ips|mipsel|ppc|ppc|iseries|ppcpseries|ppc64|m68k|m68kmint|Sgi|rs6000|i370|s390x|s390|noarch)"
|
color brightred "(i386|i486|i586|i686|athlon|ia64|alpha|alphaev5|alphaev56|alphapca56|alphaev6|alphaev67|sparc|sparcv9|sparc64armv3l|armv4b|armv4lm|ips|mipsel|ppc|ppc|iseries|ppcpseries|ppc64|m68k|m68kmint|Sgi|rs6000|i370|s390x|s390|noarch)"
|
||||||
# Architecture conditionals.
|
# Architecture conditionals.
|
||||||
color brightred "(ifarch|ifnarch)"
|
color brightred "(ifarch|ifnarch|elifarch)"
|
||||||
# OS conditionals.
|
# OS conditionals.
|
||||||
color brightred "(ifos|ifnos)"
|
color brightred "(ifos|ifnos|elifos)"
|
||||||
# %* strings.
|
# %* strings.
|
||||||
color green "%([A-Z_a-z_0-9_]*)"
|
color green "%([A-Z_a-z_0-9_]*)"
|
||||||
color magenta "%_([A-Z_a-z_0-9_]*)"
|
color magenta "%_([A-Z_a-z_0-9_]*)"
|
||||||
|
@ -27,11 +27,14 @@ color yellow start="%\{__" end="\}"
|
||||||
# Sections.
|
# Sections.
|
||||||
color red "^%(build$|changelog|check$|clean$|description|files|install$|package|pre|prep$|pretrans|preun)"
|
color red "^%(build$|changelog|check$|clean$|description|files|install$|package|pre|prep$|pretrans|preun)"
|
||||||
color red "^%(post|posttrans|postun|trigger|triggerin|triggerpostun|triggerun|verifyscript)"
|
color red "^%(post|posttrans|postun|trigger|triggerin|triggerpostun|triggerun|verifyscript)"
|
||||||
|
color red "^%(filetriggerin|filetriggerpostun|filetriggerun|transfiletriggerin|transfiletriggerpostun|transfiletriggerun)"
|
||||||
|
color red "^%(sourcelist|patchlist|generate_buildrequires)"
|
||||||
# Conditionals and defines.
|
# Conditionals and defines.
|
||||||
color brightred "%(if|else|endif|define|global|undefine)"
|
color brightred "%(if|elif|else|endif|define|global|undefine)"
|
||||||
|
|
||||||
# Comments.
|
# Comments.
|
||||||
color cyan "#.*"
|
color cyan "#.*"
|
||||||
|
color cyan "%dnl[[:space:]].*"
|
||||||
# Special case: "# norootforbuild" is handled as main tag.
|
# Special case: "# norootforbuild" is handled as main tag.
|
||||||
color brightblue "^# norootforbuild"
|
color brightblue "^# norootforbuild"
|
||||||
# %changelog date entries.
|
# %changelog date entries.
|
||||||
|
|
Loading…
Reference in New Issue