Bug 1318991 - Adding changelog entries errors
Summary: Adding changelog entries errors
Keywords:
Status: CLOSED DUPLICATE of bug 1297746
Alias: None
Product: Fedora
Classification: Fedora
Component: vim
Version: 24
Hardware: All
OS: All
unspecified
low
Target Milestone: ---
Assignee: Karsten Hopp
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-03-18 10:48 UTC by Harald Hoyer
Modified: 2016-09-14 08:14 UTC (History)
7 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2016-09-14 08:14:27 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
simple patch to accept strings in vim.command (494 bytes, patch)
2016-04-15 15:54 UTC, Jakub Jelen
no flags Details | Diff

Description Harald Hoyer 2016-03-18 10:48:41 UTC
$ rpm -qf /usr/share/vim/vim74/ftplugin/spec.vim
vim-common-7.4.1344-1.fc24.x86_64

With a spec file like this:

Name: dracut
Version: 044
Release: 18.git20160108%{?dist}

and trying to add a changelog entry with "\c", vim errors out with:

Error detected while processing function <SNR>22_SpecChangelog[49]..<SNR>22_GetRelVer:
line   20:
Traceback (most recent call last):
  File "<string>", line 17, in <module>
vim.error: Vim(let):E121: Undefined variable: git20160108


This is caused by /usr/share/vim/vim74/ftplugin/spec.vim line 44
and:
        vim.command("let rel = " + release)
which should probably be changed to:
        vim.command("let rel = \"" + release + "\"")

and maybe also:
         vim.command("let ver = " + version)
to:
         vim.command("let ver = \"" + version + "\"")

Comment 1 Jakub Jelen 2016-04-15 15:54:19 UTC
Created attachment 1147691 [details]
simple patch to accept strings in vim.command

This issue hit stable Fedora23 yesterday. Any updates?

Error detected while processing function <SNR>23_SpecChangelog[49]..<SNR>23_GetRelVer:
line   19:
Traceback (most recent call last):
  File "<string>", line 15, in <module>
vim.error: Vim(let):E15: Invalid expression: 7.2p2

Attaching patch which resolved the issue for me. Even though the behaviour is changed since the last release, at least it does not fail hard with string versions.

Comment 2 Igor Gnatenko 2016-04-15 17:36:34 UTC
I hope there should be some function like repr() in python.

Will check it tomorrow.

Comment 3 Karsten Hopp 2016-04-26 12:38:39 UTC
please test vim-7.4.1786-1.fc24, currently in f24-updates-candidate

Comment 4 Jakub Jelen 2016-04-26 14:51:34 UTC
Yes. It seems to fix the original problem. Thank you.

Comment 5 Othman Madjoudj 2016-04-29 21:18:11 UTC
FYI, vim-enhanced-7.4.1797-3.fc23 (koji build 758616) still has the issue while in the changelog states that it was fixed.

]$ rpm -q --changelog vim-enhanced |head -n 30
* Fri Apr 29 2016 Karsten Hopp <karsten> - 7.4.1797-3
[...]
* Tue Apr 26 2016 Karsten Hopp <karsten> - 7.4.1775-2
- fix error in spec.vim (rhbz#1318991)

[...]


$ vi /usr/share/vim/vim74/ftplugin/spec.vim

[...]
42         version = headers["Version"]
43         release = headers["Release"]
44         vim.command("let ver = " + version)
45         vim.command("let rel = " + release)
46 PYEND   

[...]

Comment 6 fszymanski 2016-07-01 12:19:05 UTC
Try out: https://github.com/fszymanski/vim-spec

Comment 7 Jakub Jelen 2016-07-18 11:52:09 UTC
It is broken again:

Error detected while processing function <SNR>22_SpecChangelog[49]..<SNR>22_GetRelVer:
line   20:
Traceback (most recent call last):
  File "<string>", line 16, in <module>
vim.error: Vim(let):E15: Invalid expression: 7.2p2
Press ENTER or type command to continue

both on Fedora 23 and Fedora 24:
vim-common-7.4.1868-1.fc23.x86_64
vim-common-7.4.1868-1.fc24.x86_64

Fixing using the above patch will suppress the error, but won't append the version and release. If you search for a reproducer, openssh spec file is a good candidate.

Comment 8 Igor Gnatenko 2016-09-14 08:14:27 UTC

*** This bug has been marked as a duplicate of bug 1297746 ***


Note You need to log in before you can comment on or make changes to this bug.