Bug 1297746 - pi_spec does not work with %global instead of %define [NEEDINFO]
Summary: pi_spec does not work with %global instead of %define
Keywords:
Status: ASSIGNED
Alias: None
Product: Fedora
Classification: Fedora
Component: vim
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Leigh Griffin
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1318991 1332184 (view as bug list)
Depends On:
Blocks: 1332184
TreeView+ depends on / blocked
 
Reported: 2016-01-12 11:27 UTC by Jakub Jelen
Modified: 2022-08-30 12:14 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Embargoed:
zdohnal: needinfo? (igor.raits)


Attachments (Terms of Use)
uggly local patch for f23 package (714 bytes, patch)
2016-01-12 11:33 UTC, Jakub Jelen
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Github vim vim issues 3842 0 'None' closed Specfile filetype plugin is not working properly 2020-09-16 10:11:05 UTC

Description Jakub Jelen 2016-01-12 11:27:51 UTC
Description of problem:
After the move from %define to %global [1], pi_spec plugin [2] for generating %changelog items stopped working. The plugin has hard-coded only %define so it ignores %global definitions.

I see there some ongoing work in master branch, thought I was not able to apply the f24 patches. Even though I would like to see in F23 especially these features, if possible.

Version-Release number of selected component (if applicable):
vim-common-7.4.827-1.fc23.x86_64

How reproducible:
always

Steps to Reproduce:
1. Open spec file for example [3]
2. Press <Leader>c or \c

Actual results:
The inserted changelog item is missing version information:
* Tue Jan 12 2016 Jakub Jelen <jjelen> -

Expected results:
%define should behave the same way s %global, if it is part of the guidelines
* Tue Jan 12 2016 Jakub Jelen <jjelen> 7.1p1-6

Additional info:
[1] https://lists.fedoraproject.org/archives/list/devel%40lists.fedoraproject.org/thread/AS35NKZSAWRIKY77IUYOVNFAT6AJQVAU/
[2] http://vimdoc.sourceforge.net/htmldoc/pi_spec.html
[3] http://pkgs.fedoraproject.org/cgit/rpms/openssh.git/tree/openssh.spec

Comment 1 Jakub Jelen 2016-01-12 11:33:09 UTC
Created attachment 1113908 [details]
uggly local patch for f23 package

Comment 2 Jonathan Wakely 2016-01-12 12:26:52 UTC
To be clear, the problem is that the plugin doesn't recognise things like:

%global ver 1.0
Version: %{ver}

Comment 3 Karsten Hopp 2016-04-28 12:12:40 UTC
This is not fixed with the latest upstream spec.vim files. Igor, could  you take a look please ?

Comment 4 Igor Gnatenko 2016-04-28 12:14:58 UTC
(In reply to Karsten Hopp from comment #3)
> This is not fixed with the latest upstream spec.vim files. Igor, could  you
> take a look please ?

https://github.com/ignatenkobrain/vim-spec-plugin/commit/642a0e2d717601efd1e7d69e09fa8d9b62901990

I will send updated plugin to Bram over this week.

Comment 5 Karsten Hopp 2016-04-29 13:21:33 UTC
This problem still exists with https://raw.githubusercontent.com/ignatenkobrain/vim-spec-plugin/master/ftplugin/spec.vim as of today


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

Comment 6 Karsten Hopp 2016-05-24 13:10:05 UTC
the latest https://raw.githubusercontent.com/ignatenkobrain/vim-spec-plugin/master/ftplugin/spec.vim is broken even with normal definitions like the vim specfile uses itself:
%define patchlevel 1835
%define baseversion 7.4
Version: %{baseversion}.%{patchlevel}
Release: 2%{?dist}

results in:
* Tue May 24 2016 Karsten Hopp <karsten> - .-2

Comment 7 Igor Gnatenko 2016-09-14 08:13:48 UTC
*** Bug 1332184 has been marked as a duplicate of this bug. ***

Comment 8 Igor Gnatenko 2016-09-14 08:14:27 UTC
*** Bug 1318991 has been marked as a duplicate of this bug. ***

Comment 9 Igor Gnatenko 2016-09-14 08:15:20 UTC
Sorry, I don't have time to work on it in near future. All Pull Requests are very welcomed.

Comment 10 Jason Tibbitts 2016-09-14 13:52:36 UTC
I took a look a while back and as far as I can see, the plugin _should_ be using embedded python to call into rpm to parse the specfile and extract the version information.  However, that doesn't seem to happen and I can't tell how it would ever actually function.  If anyone has any hints, I can try poking at it.

Alternately, just shelling out to rpmspec should be completely sufficient, assuming that's acceptable:

rpmspec --define '%dist %nil' -q *spec --qf '%{VERSION}-%{RELEASE}\n'|head -1

My comprehension of vimscript is pretty horrible, though, so if anyone has any hints....

Comment 11 Igor Gnatenko 2016-09-14 14:02:28 UTC
(In reply to Jason Tibbitts from comment #10)
> I took a look a while back and as far as I can see, the plugin _should_ be
> using embedded python to call into rpm to parse the specfile and extract the
> version information.  However, that doesn't seem to happen and I can't tell
> how it would ever actually function.  If anyone has any hints, I can try
> poking at it.
> 
> Alternately, just shelling out to rpmspec should be completely sufficient,
> assuming that's acceptable:
> 
> rpmspec --define '%dist %nil' -q *spec --qf '%{VERSION}-%{RELEASE}\n'|head -1
> 
> My comprehension of vimscript is pretty horrible, though, so if anyone has
> any hints....

I think we should drop any manual parsing from plugin and add Requires: pythonX-rpm. It's only one reliable way.

Comment 12 Jason Tibbitts 2016-09-14 15:15:30 UTC
I agree, except that there's already code in there to call into python, and I already have rpm-python and rpm-python3 (both misnamed) installed on my system.  So that code just isn't getting called at all.  Figuring out why would be a good first step, I think.  Hopefully soon I'll learn enough vimscript to be able to dig deeper.

Comment 13 Karsten Hopp 2016-10-05 11:08:15 UTC
I'll try to have a look at it soon.

Comment 14 Fedora End Of Life 2016-11-24 14:52:01 UTC
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '23'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 23 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 15 Fedora End Of Life 2017-07-25 19:45:51 UTC
This message is a reminder that Fedora 24 is nearing its end of life.
Approximately 2 (two) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 24. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '24'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 24 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 16 Jakub Jelen 2017-07-31 11:46:24 UTC
I am still seeing issues with Fedora 26 and OpenSSH spec file.

Comment 17 Fedora End Of Life 2018-05-03 08:04:50 UTC
This message is a reminder that Fedora 26 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 26. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '26'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 26 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 18 Jonathan Wakely 2018-05-03 17:17:46 UTC
Still present in f27

Comment 19 Ben Cotton 2018-11-27 14:49:29 UTC
This message is a reminder that Fedora 27 is nearing its end of life.
On 2018-Nov-30  Fedora will stop maintaining and issuing updates for
Fedora 27. It is Fedora's policy to close all bug reports from releases
that are no longer maintained. At that time this bug will be closed as
EOL if it remains open with a Fedora  'version' of '27'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 27 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 20 Jonathan Wakely 2018-11-29 10:25:36 UTC
Setting FutureFeature because this hasn't been fixed in F29, and I hate the EOL bot.

Comment 22 Zdenek Dohnal 2020-09-02 07:17:34 UTC
Hi Igor,

Tomas created the pull request for Vim which fixes the issue.

Do you agree with the changes presented in pull request? We need your approval (as plugin maintainer) because the previous pull request was closed because it didn't have a maintainer approval.


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