Bug 1391564

Summary: vim-update.sh incorrectly treats patchlevel number as octal number
Product: [Fedora] Fedora Reporter: Ting-Wei Lan <lantw44>
Component: vimAssignee: Karsten Hopp <karsten>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: rawhideCC: karsten, lantw44, moshima.web, zdohnal
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-11-14 18:57:10 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Ting-Wei Lan 2016-11-03 14:43:03 UTC
Description of problem:
The build for vim 8.0.45 in rawhide has incorrect Version-Release number 8.0.037-1.fc26.

Version-Release number of selected component (if applicable):
vim-8.0.037-1.fc26

How reproducible:
Install vim on rawhide

Steps to Reproduce:
1. Run 'rpm -q vim-enhanced'.
2. Run 'vim --version'.
3. See the version number mismatch between the two.

Actual results:
vim-8.0.037-1.fc26
VIM - Vi IMproved 8.0 Included patches: 1-45

Expected results:
vim-8.0.045-1.fc26
VIM - Vi IMproved 8.0 Included patches: 1-45

Additional info:
The error is caused by these two lines in vim-update.sh:
LASTPL=`echo $LASTTAG| sed -e 's/.*\.//'`
LASTPLFILLED=`printf "%03d" $LASTPL`

If $LASTPL has leading zero like '045', printf command will treat it as an octal number and do the conversion from octal to decimal. This also causes vim-update.sh to fail to run if any of the last two digits is 8 or 9.

Comment 1 Karsten Hopp 2016-11-14 15:46:42 UTC
should be fixed in git, please try again

Comment 2 Zdenek Dohnal 2016-11-14 16:08:39 UTC
It works for me.

Comment 3 Ting-Wei Lan 2016-11-14 18:57:10 UTC
Yes, master branch of git://pkgs.fedoraproject.org/rpms/vim.git works for me now.