[arch-commits] Commit in vim/trunk (PKGBUILD xz.patch)
Daniel Griffiths
dgriffiths at archlinux.org
Sun May 16 23:13:28 UTC 2010
Date: Sunday, May 16, 2010 @ 19:13:28
Author: dgriffiths
Revision: 80379
Added:
vim/trunk/xz.patch
Modified:
vim/trunk/PKGBUILD
----------+
PKGBUILD | 38 ++++++++----
xz.patch | 193 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 220 insertions(+), 11 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2010-05-16 21:06:40 UTC (rev 80378)
+++ PKGBUILD 2010-05-16 23:13:28 UTC (rev 80379)
@@ -4,24 +4,26 @@
pkgbase=vim
pkgname=(vim gvim vim-runtime)
-_srcver=7.2
-__hgrev=2150
-pkgver=${_srcver}.${__hgrev}
+pkgver=7.2
+__hgrev=e12b9d992389
pkgrel=1
arch=('i686' 'x86_64')
license=('custom:vim')
url="http://www.vim.org"
makedepends=('gpm' 'perl' 'python' 'ruby' 'libxt' 'desktop-file-utils' 'gtk2'
'gettext' 'pkgconfig' 'mercurial' 'rsync' 'sed')
+options=(force)
source=(pythoncomplete.vim::http://www.vim.org/scripts/download_script.php\?src_id=10872
- vimrc archlinux.vim gvim.desktop)
+ vimrc archlinux.vim gvim.desktop xz.patch)
md5sums=('6e7adfbd5d26c1d161030ec203a7f243' 'e57777374891063b9ca48a1fe392ac05'
- '10353a61aadc3f276692d0e17db1478e' '2be104c0372dd6dae19cb7968c03cd4f')
+ '10353a61aadc3f276692d0e17db1478e' '2be104c0372dd6dae19cb7968c03cd4f'
+ '634bea72f47b608634419724a12b2505')
__hgroot='http://vim.googlecode.com/hg/'
__hgrepo='vim'
+__hgbranch='default'
-_versiondir="vim${_srcver//./}"
+_versiondir="vim${pkgver//./}"
##### Build #####
@@ -31,11 +33,21 @@
msg2 'Checking out source from Mercurial...'
if [[ -d ${__hgrepo} ]]; then
- ( cd ${__hgrepo}; hg pull; hg update -r ${__hgrev}) || return 1
+ cd ${__hgrepo}
+ hg pull -b ${__hgbranch}|| warning 'hg pull failed!'
+ hg update -r ${__hgrev} || return 1
else
- hg clone -u ${__hgrev} "${__hgroot}${__hgrepo}" ${__hgrepo} || return 1
+ hg clone -b ${__hgbranch} -u ${__hgrev} "${__hgroot}${__hgrepo}" ${__hgrepo} || return 1
+ cd ${__hgrepo}
fi
+ if (( $(hg id -n) < $(hg id -nr ${__hgbranch}) )); then
+ warning 'You are not building the latest revision!'
+ warning "Consider updating __hgrev to $(hg id -r ${__hgbranch})."
+ sleep 10
+ fi
+
+ cd ..
rm -rf vim-build gvim-build
rsync -a --exclude='.hg/' ${__hgrepo}/ vim-build || return 1
@@ -78,7 +90,7 @@
package_vim() {
pkgdesc='Vi Improved, a highly configurable, improved version of the vi text editor'
- depends=("vim-runtime=${pkgver}" 'gpm' 'perl')
+ depends=("vim-runtime=${pkgver}-${pkgrel}" 'gpm' 'perl')
conflicts=('gvim')
cd ${srcdir}/vim-build
@@ -106,9 +118,9 @@
package_gvim() {
pkgdesc='Vi Improved, a highly configurable, improved version of the vi text editor (with advanced features, such as a GUI)'
- depends=("vim-runtime=${pkgver}" 'gpm' 'perl' 'python' 'ruby' 'libxt'
+ depends=("vim-runtime=${pkgver}-${pkgrel}" 'gpm' 'perl' 'python' 'ruby' 'libxt'
'desktop-file-utils' 'gtk2')
- provides=("vim=${pkgver}")
+ provides=("vim=${pkgver}-${pkgrel}")
conflicts=('vim')
install=gvim.install
@@ -161,6 +173,10 @@
sed -i "/find the end/,+3{s/changelog_date_entry_search/changelog_date_end_entry_search/}" \
${pkgdir}/usr/share/vim/vim72/ftplugin/changelog.vim
+ # patch runtime for better support of .*.xz files
+ cd ${pkgdir}/usr/share/vim
+ patch -p0 < ${srcdir}/xz.patch || return 1
+
# make Aaron happy
install -Dm644 ${srcdir}/pythoncomplete.vim \
${pkgdir}/usr/share/vim/vim72/autoload/pythoncomplete.vim
Added: xz.patch
===================================================================
--- xz.patch (rev 0)
+++ xz.patch 2010-05-16 23:13:28 UTC (rev 80379)
@@ -0,0 +1,193 @@
+diff -uNr vim72/autoload/getscript.vim vim72-xz/autoload/getscript.vim
+--- vim72/autoload/getscript.vim 2010-05-16 22:33:59.000000000 +0200
++++ vim72-xz/autoload/getscript.vim 2010-05-16 22:41:34.930283754 +0200
+@@ -557,6 +557,11 @@
+ exe "silent !gunzip ".shellescape(sname)
+ let sname= substitute(sname,'\.gz$','','')
+ " call Decho("decompress: new sname<".sname."> after gunzip")
++ elseif sname =~ '\.xz$'
++" call Decho("decompress: attempt to unxz ".sname)
++ exe "silent !unxz ".shellescape(sname)
++ let sname= substitute(sname,'\.xz$','','')
++" call Decho("decompress: new sname<".sname."> after unxz")
+ else
+ " call Decho("no decompression needed")
+ endif
+diff -uNr vim72/autoload/netrw.vim vim72-xz/autoload/netrw.vim
+--- vim72/autoload/netrw.vim 2010-05-16 22:33:59.000000000 +0200
++++ vim72-xz/autoload/netrw.vim 2010-05-16 22:40:28.007276216 +0200
+@@ -163,7 +163,7 @@
+ endif
+ " Default values - d-g ---------- {{{3
+ call s:NetrwInit("g:netrw_dirhist_cnt" , 0)
+-call s:NetrwInit("g:netrw_decompress" , '{ ".gz" : "gunzip", ".bz2" : "bunzip2", ".zip" : "unzip", ".tar" : "tar -xf"}')
++call s:NetrwInit("g:netrw_decompress" , '{ ".gz" : "gunzip", ".bz2" : "bunzip2", ".xz" : "unxz", ".zip" : "unzip", ".tar" : "tar -xf" }')
+ call s:NetrwInit("g:netrw_dirhistmax" , 10)
+ call s:NetrwInit("g:netrw_fastbrowse" , 1)
+ call s:NetrwInit("g:netrw_ftp_browse_reject", '^total\s\+\d\+$\|^Trying\s\+\d\+.*$\|^KERBEROS_V\d rejected\|^Security extensions not\|No such file\|: connect to address [0-9a-fA-F:]*: No route to host$')
+@@ -920,7 +920,7 @@
+ unlet b:netrw_method
+ unlet b:netrw_fname
+ endif
+- if s:FileReadable(tmpfile) && tmpfile !~ '.tar.bz2$' && tmpfile !~ '.tar.gz$' && tmpfile !~ '.zip' && tmpfile !~ '.tar' && readcmd != 't'
++ if s:FileReadable(tmpfile) && tmpfile !~ '.tar.xz$' && tmpfile !~ '.tar.bz2$' && tmpfile !~ '.tar.gz$' && tmpfile !~ '.zip' && tmpfile !~ '.tar' && readcmd != 't'
+ " call Decho("cleanup by deleting tmpfile<".tmpfile.">")
+ call s:NetrwDelete(tmpfile)
+ endif
+@@ -1387,6 +1387,9 @@
+ elseif rfile =~ '\.tar\.bz2'
+ " call Decho("handling remote bz2-compressed tar file")
+ call tar#Browse(tfile)
++ elseif rfile =~ '\.tar\.xz'
++" call Decho("handling remote xz-compressed tar file")
++ call tar#Browse(tfile)
+ else
+ " call Decho("edit temporary file")
+ e!
+@@ -2312,7 +2315,7 @@
+ exe "sil! keepalt file ".fnameescape(s:method."://".s:user.s:machine."/".s:path)
+ exe "sil keepalt doau BufReadPre ".fnameescape(s:fname)
+ silent call netrw#NetRead(2,s:method."://".s:user.s:machine."/".s:path)
+- if s:path !~ '.tar.bz2$' && s:path !~ '.tar.gz'
++ if s:path !~ '.tar.xz' && s:path !~ '.tar.bz2$' && s:path !~ '.tar.gz'
+ " netrw.vim and tar.vim have already handled decompression of the tarball; avoiding gzip.vim error
+ exe "sil keepalt doau BufReadPost ".fnameescape(s:fname)
+ endif
+@@ -4390,7 +4393,7 @@
+ " using g:netrw_compress_suffix to know which to
+ " do. By default:
+ " g:netrw_compress = "gzip"
+-" g:netrw_decompress = { ".gz" : "gunzip" , ".bz2" : "bunzip2" , ".zip" : "unzip" , ".tar" : "tar -xf"}
++" g:netrw_decompress = { ".gz" : "gunzip" , ".bz2" : "bunzip2" , ".xz" : "unxz", ".zip" : "unzip" , ".tar" : "tar -xf"}
+ fun! s:NetrwMarkFileCompress(islocal)
+ " call Dfunc("s:NetrwMarkFileCompress(islocal=".a:islocal.")")
+ let svpos = netrw#NetrwSavePosn()
+@@ -7868,7 +7871,7 @@
+ if a:fname != ""
+ if a:fname =~ '\.[^./]\+$'
+ " call Decho("using fname<".a:fname.">'s suffix")
+- if a:fname =~ '.tar.gz' || a:fname =~ '.tar.bz2'
++ if a:fname =~ '.tar.gz' || a:fname =~ '.tar.bz2' || a:fname =~ '.tar.xz'
+ let suffix = ".tar".substitute(a:fname,'^.*\(\.[^./]\+\)$','\1','e')
+ else
+ let suffix = substitute(a:fname,'^.*\(\.[^./]\+\)$','\1','e')
+diff -uNr vim72/autoload/tar.vim vim72-xz/autoload/tar.vim
+--- vim72/autoload/tar.vim 2010-05-16 22:33:59.000000000 +0200
++++ vim72-xz/autoload/tar.vim 2010-05-16 22:43:47.552260967 +0200
+@@ -164,6 +164,9 @@
+ elseif tarfile =~# '\.lzma$'
+ " call Decho("3: exe silent r! lzma -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - ")
+ exe "silent r! lzma -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - "
++ elseif tarfile =~# '\.xz$'
++" call Decho("3: exe silent r! xz -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - ")
++ exe "silent r! xz -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - "
+ else
+ if tarfile =~ '^\s*-'
+ " A file name starting with a dash is taken as an option. Prepend ./ to avoid that.
+@@ -265,10 +268,13 @@
+ elseif fname =~ '\.lzma$' && executable("lzcat")
+ let decmp= "|lzcat"
+ let doro = 1
++ elseif fname =~ '\.xz$' && executable("xzcat")
++ let decmp= "|xzcat"
++ let doro = 1
+ else
+ let decmp=""
+ let doro = 0
+- if fname =~ '\.bz2$\|\.gz$\|\.lzma$\|\.zip$\|\.Z$'
++ if fname =~ '\.bz2$\|\.gz$\|\.lzma$\|\.xz$\|\.zip$\|\.Z$'
+ setlocal bin
+ endif
+ endif
+@@ -290,6 +296,9 @@
+ elseif tarfile =~# '\.lzma$'
+ " call Decho("7: exe silent r! lzma -d -c ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp)
+ exe "silent r! lzma -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp
++ elseif tarfile =~# '\.xz$'
++" call Decho("7: exe silent r! xz -d -c ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp)
++ exe "silent r! xz -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp
+ else
+ if tarfile =~ '^\s*-'
+ " A file name starting with a dash is taken as an option. Prepend ./ to avoid that.
+@@ -393,6 +402,11 @@
+ let tarfile = substitute(tarfile,'\.lzma','','e')
+ let compress= "lzma -- ".shellescape(tarfile,0)
+ " call Decho("compress<".compress.">")
++ elseif tarfile =~# '\.xz'
++ call system("xz -d -- ".shellescape(tarfile,0))
++ let tarfile = substitute(tarfile,'\.xz','','e')
++ let compress= "xz -- ".shellescape(tarfile,0)
++" call Decho("compress<".compress.">")
+ elseif tarfile =~# '\.tgz'
+ call system("gzip -d -- ".shellescape(tarfile,0))
+ let tarfile = substitute(tarfile,'\.tgz','.tar','e')
+diff -uNr vim72/autoload/vimball.vim vim72-xz/autoload/vimball.vim
+--- vim72/autoload/vimball.vim 2010-05-16 22:33:59.000000000 +0200
++++ vim72-xz/autoload/vimball.vim 2010-05-16 22:45:32.614510143 +0200
+@@ -505,6 +505,26 @@
+ exe "e ".escape(fname,' \')
+ if a:0 == 0| call vimball#ShowMesg(s:USAGE,"Source this file to extract it! (:so %)") | endif
+
++ elseif expand("%") =~ '.*\.xz' && executable("unxz")
++ " handle *.xz with unxz
++ silent exe "!unxz ".shellescape(a:fname)
++ if v:shell_error != 0
++ call vimball#ShowMesg(s:WARNING,"(vimball#Decompress) unxz may have failed with <".a:fname.">")
++ endif
++ let fname= substitute(a:fname,'\.xz$','','')
++ exe "e ".escape(fname,' \')
++ if a:0 == 0| call vimball#ShowMesg(s:USAGE,"Source this file to extract it! (:so %)") | endif
++
++ elseif expand("%") =~ '.*\.xz' && executable("xz")
++ " handle *.xz with xz -d
++ silent exe "!xz -d ".shellescape(a:fname)
++ if v:shell_error != 0
++ call vimball#ShowMesg(s:WARNING,'(vimball#Decompress) "xz -d" may have failed with <'.a:fname.">")
++ endif
++ let fname= substitute(a:fname,'\.xz$','','')
++ exe "e ".escape(fname,' \')
++ if a:0 == 0| call vimball#ShowMesg(s:USAGE,"Source this file to extract it! (:so %)") | endif
++
+ elseif expand("%") =~ '.*\.zip' && executable("unzip")
+ " handle *.zip with unzip
+ silent exe "!unzip ".shellescape(a:fname)
+diff -uNr vim72/filetype.vim vim72-xz/filetype.vim
+--- vim72/filetype.vim 2010-05-16 22:34:09.000000000 +0200
++++ vim72-xz/filetype.vim 2010-05-16 22:47:29.343285870 +0200
+@@ -37,7 +37,7 @@
+ " Pattern used to match file names which should not be inspected.
+ " Currently finds compressed files.
+ if !exists("g:ft_ignore_pat")
+- let g:ft_ignore_pat = '\.\(Z\|gz\|bz2\|zip\|tgz\)$'
++ let g:ft_ignore_pat = '\.\(Z\|gz\|bz2\|xz\|zip\|tgz\)$'
+ endif
+
+ " Function used for patterns that end in a star: don't set the filetype if the
+diff -uNr vim72/plugin/tarPlugin.vim vim72-xz/plugin/tarPlugin.vim
+--- vim72/plugin/tarPlugin.vim 2010-05-16 22:33:59.000000000 +0200
++++ vim72-xz/plugin/tarPlugin.vim 2010-05-16 22:46:39.220270785 +0200
+@@ -39,8 +39,9 @@
+ au BufReadCmd *.lrp call tar#Browse(expand("<amatch>"))
+ au BufReadCmd *.tar.bz2 call tar#Browse(expand("<amatch>"))
+ au BufReadCmd *.tar.Z call tar#Browse(expand("<amatch>"))
++ au BufReadCmd *.tar.lzma call tar#Browse(expand("<amatch>"))
++ au BufReadCmd *.tar.xz call tar#Browse(expand("<amatch>"))
+ au BufReadCmd *.tgz call tar#Browse(expand("<amatch>"))
+- au BufReadCmd *.tar.lzma call tar#Browse(expand("<amatch>"))
+ augroup END
+ com! -nargs=? -complete=file Vimuntar call tar#Vimuntar(<q-args>)
+
+diff -uNr vim72/plugin/vimballPlugin.vim vim72-xz/plugin/vimballPlugin.vim
+--- vim72/plugin/vimballPlugin.vim 2010-05-16 22:33:59.000000000 +0200
++++ vim72-xz/plugin/vimballPlugin.vim 2010-05-16 22:47:07.425260844 +0200
+@@ -26,8 +26,8 @@
+ com! -na=? -complete=dir UseVimball call vimball#Vimball(1,<f-args>)
+ com! -na=0 VimballList call vimball#Vimball(0)
+ com! -na=* -complete=dir RmVimball call vimball#SaveSettings()|call vimball#RmVimball(<f-args>)|call vimball#RestoreSettings()
+-au SourceCmd *.vba.gz,*.vba.bz2,*.vba.zip call vimball#Decompress(expand("<amatch>"))|call vimball#Vimball(1)
+-au BufEnter *.vba,*.vba.gz,*.vba.bz2,*.vba.zip setlocal bt=nofile fmr=[[[,]]] fdm=marker|if &ff != 'unix'| setlocal ma ff=unix noma |endif|call vimball#ShowMesg(0,"Source this file to extract it! (:so %)")
++au SourceCmd *.vba.gz,*.vba.bz2,*.vba.xz,*.vba.zip call vimball#Decompress(expand("<amatch>"))|call vimball#Vimball(1)
++au BufEnter *.vba,*.vba.gz,*.vba.bz2,*.vba.xz,*.vba.zip setlocal bt=nofile fmr=[[[,]]] fdm=marker|if &ff != 'unix'| setlocal ma ff=unix noma |endif|call vimball#ShowMesg(0,"Source this file to extract it! (:so %)")
+
+ " =====================================================================
+ " Restoration And Modelines: {{{1
More information about the arch-commits
mailing list