Accepting request 21203 from editors

Copy from editors/vim based on submit request 21203 from user WernerFink

OBS-URL: https://build.opensuse.org/request/show/21203
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/vim?expand=0&rev=37
This commit is contained in:
OBS User autobuild
2009-09-28 15:26:50 +00:00
committed by Git OBS Bridge
parent 3c5fc34d14
commit 8a104449b1
3 changed files with 28 additions and 624 deletions

View File

@@ -3,24 +3,29 @@
function! SKEL_spec()
0r /usr/share/vim/current/skeletons/skeleton.spec
language time en_US
let login = system('whoami')
if v:shell_error
let login = 'unknown'
if $USER != ''
let login = $USER
elseif $LOGNAME != ''
let login = $LOGNAME
else
let newline = stridx(login, "\n")
if newline != -1
let login = strpart(login, 0, newline)
endif
let login = 'unknown'
endif
let hostname = system('hostname -f')
if v:shell_error
let hostname = 'localhost'
let newline = stridx(login, "\n")
if newline != -1
let login = strpart(login, 0, newline)
endif
if $HOSTNAME != ''
let hostname = $HOSTNAME
else
let newline = stridx(hostname, "\n")
if newline != -1
let hostname = strpart(hostname, 0, newline)
let hostname = system('hostname -f')
if v:shell_error
let hostname = 'localhost'
endif
endif
let newline = stridx(hostname, "\n")
if newline != -1
let hostname = strpart(hostname, 0, newline)
endif
exe "%s/specRPM_CREATION_DATE/" . strftime("%a\ %b\ %d\ %Y") . "/ge"
exe "%s/specRPM_CREATION_AUTHOR_MAIL/" . login . "@" . hostname . "/ge"
exe "%s/specRPM_CREATION_NAME/" . expand("%:t:r") . "/ge"