commit ad52830fb8eefba053ff3ee12f9e853fc3cbfea1
parent c802f91f4e80797d805c09486fb0673eb80c31c1
Author: Neal Gompa <ngompa13@gmail.com>
Date: Sat, 22 Feb 2020 19:30:43 -0500
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>
Diffstat:
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/syntax/spec.nanorc b/syntax/spec.nanorc
@@ -15,9 +15,9 @@ color brightblue start="^Source" end=":" start="^Patch" end=":"
# 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)"
# Architecture conditionals.
-color brightred "(ifarch|ifnarch)"
+color brightred "(ifarch|ifnarch|elifarch)"
# OS conditionals.
-color brightred "(ifos|ifnos)"
+color brightred "(ifos|ifnos|elifos)"
# %* strings.
color green "%([A-Z_a-z_0-9_]*)"
color magenta "%_([A-Z_a-z_0-9_]*)"
@@ -27,11 +27,14 @@ color yellow start="%\{__" end="\}"
# Sections.
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 "^%(filetriggerin|filetriggerpostun|filetriggerun|transfiletriggerin|transfiletriggerpostun|transfiletriggerun)"
+color red "^%(sourcelist|patchlist|generate_buildrequires)"
# Conditionals and defines.
-color brightred "%(if|else|endif|define|global|undefine)"
+color brightred "%(if|elif|else|endif|define|global|undefine)"
# Comments.
color cyan "#.*"
+color cyan "%dnl[[:space:]].*"
# Special case: "# norootforbuild" is handled as main tag.
color brightblue "^# norootforbuild"
# %changelog date entries.