summaryrefslogtreecommitdiff
path: root/runtime/ftplugin
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-06-04 20:20:29 +0200
committerBram Moolenaar <Bram@vim.org>2016-06-04 20:20:29 +0200
commit82af8710bf8d1caeeceafb1370a052cb7d92f076 (patch)
tree19794ae3a1140f200d86e8d0ec5cd7c6a8679858 /runtime/ftplugin
parent82faa259cc42379f2a17d598a2a39d14048685b0 (diff)
downloadvim-git-82af8710bf8d1caeeceafb1370a052cb7d92f076.tar.gz
Updated runtime files.
Diffstat (limited to 'runtime/ftplugin')
-rw-r--r--runtime/ftplugin/spec.vim18
1 files changed, 9 insertions, 9 deletions
diff --git a/runtime/ftplugin/spec.vim b/runtime/ftplugin/spec.vim
index 6d5bf4b80..2a961f824 100644
--- a/runtime/ftplugin/spec.vim
+++ b/runtime/ftplugin/spec.vim
@@ -36,10 +36,11 @@ except ImportError:
else:
specfile = vim.current.buffer.name
if specfile:
+ rpm.delMacro("dist")
spec = rpm.spec(specfile)
- headers = spec.packages[0].header
- version = headers['Version']
- release = ".".join(headers['Release'].split(".")[:-1])
+ headers = spec.sourceHeader
+ version = headers["Version"]
+ release = headers["Release"]
vim.command("let ver = " + version)
vim.command("let rel = " + release)
PYEND
@@ -113,7 +114,10 @@ if !exists("*s:SpecChangelog")
endif
endif
if (chgline != -1)
+ let tmptime = v:lc_time
+ language time C
let parsed_format = "* ".strftime(format)." - ".ver."-".rel
+ execute "language time" tmptime
let release_info = "+ ".name."-".ver."-".rel
let wrong_format = 0
let wrong_release = 0
@@ -179,12 +183,8 @@ if !exists("*s:ParseRpmVars")
endif
let varname = strpart(a:str, start+2, end-(start+2))
execute a:strline
- let definestr = "^[ \t]*%define[ \t]\\+" . varname . "[ \t]\\+\\(.*\\)$"
+ let definestr = "^[ \t]*%(?:global|define)[ \t]\\+" . varname . "[ \t]\\+\\(.*\\)$"
let linenum = search(definestr, "bW")
- if (linenum == 0)
- let definestr = substitute(definestr, "%define", "%global", "")
- let linenum = search(definestr, "bW")
- endif
if (linenum != -1)
let ret = ret . substitute(getline(linenum), definestr, "\\1", "")
else
@@ -201,7 +201,7 @@ endif
let b:match_ignorecase = 0
let b:match_words =
- \ '^Name:^%description:^%clean:^%setup:^%build:^%install:^%files:' .
+ \ '^Name:^%description:^%clean:^%(?:auto)?setup:^%build:^%install:^%files:' .
\ '^%package:^%preun:^%postun:^%changelog'
let &cpo = s:cpo_save