Sophie

Sophie

distrib > Mandriva > mes5 > x86_64 > by-pkgid > da1cd862f68e9a90976a3d97518eaa8a > files > 20

vim-7.2.065-9.4mdv2009.0.src.rpm

--- vim71/runtime/plugin/gzip.vim~	2005-07-26 15:17:59.000000000 +0200
+++ vim71/runtime/plugin/gzip.vim	2007-07-10 14:32:54.000000000 +0200
@@ -20,17 +20,21 @@ augroup gzip
   "
   " Set binary mode before reading the file.
   " Use "gzip -d", gunzip isn't always available.
-  autocmd BufReadPre,FileReadPre	*.gz,*.bz2,*.Z setlocal bin
+  autocmd BufReadPre,FileReadPre	*.gz,*.bz2,*.Z,*.lzma setlocal bin
   autocmd BufReadPost,FileReadPost	*.gz  call gzip#read("gzip -dn")
   autocmd BufReadPost,FileReadPost	*.bz2 call gzip#read("bzip2 -d")
   autocmd BufReadPost,FileReadPost	*.Z   call gzip#read("uncompress")
+  autocmd BufReadPost,FileReadPost	*.lzma call gzip#read("lzma -d")
   autocmd BufWritePost,FileWritePost	*.gz  call gzip#write("gzip")
   autocmd BufWritePost,FileWritePost	*.bz2 call gzip#write("bzip2")
   autocmd BufWritePost,FileWritePost	*.Z   call gzip#write("compress -f")
+  autocmd BufWritePost,FileWritePost	*.lzma call gzip#write("lzma")
   autocmd FileAppendPre			*.gz  call gzip#appre("gzip -dn")
   autocmd FileAppendPre			*.bz2 call gzip#appre("bzip2 -d")
   autocmd FileAppendPre			*.Z   call gzip#appre("uncompress")
+  autocmd FileAppendPre			*.lzma call gzip#appre("lzma -d")
   autocmd FileAppendPost		*.gz  call gzip#write("gzip")
   autocmd FileAppendPost		*.bz2 call gzip#write("bzip2")
   autocmd FileAppendPost		*.Z   call gzip#write("compress -f")
+  autocmd FileAppendPost		*.lzma call gzip#write("lzma")
 augroup END
diff -p -up ./runtime/autoload/tar.vim.lzma_support ./runtime/autoload/tar.vim
--- ./runtime/autoload/tar.vim.lzma_support	2008-08-09 16:14:58.000000000 +0200
+++ ./runtime/autoload/tar.vim	2008-08-27 14:53:48.000000000 +0200
@@ -371,6 +371,14 @@ fun! tar#Write(fname)
    let tarfile = substitute(tarfile,'\.bz2','','e')
    let compress= "bzip2 -- ".s:Escape(tarfile,0)
 "   call Decho("compress<".compress.">")
+  elseif tarfile =~# '\.lzma'
+   call system("lzma -d ".tarfile)
+   let tarfile = substitute(tarfile,'\.lzma','','e')
+   let compress= "lzma '".tarfile."'"
+  elseif tarfile =~# '\.tlz'
+   call system("lzma -d ".tarfile)
+   let tarfile = substitute(tarfile,'\.tlz','tar','e')
+   let compress= "lzma '".tarfile."'"
   endif
 "  call Decho("tarfile<".tarfile.">")
 
--- ./runtime/autoload/getscript.vim.lzma_support	2008-07-10 20:17:15.000000000 +0200
+++ ./runtime/autoload/getscript.vim	2008-08-27 14:54:40.000000000 +0200
@@ -542,6 +542,11 @@ fun! s:GetOneScript(...)
       exe "silent !gunzip ".s:Escape(sname)
       let sname= substitute(sname,'\.gz$','','')
 "      call Decho("decompress: new sname<".sname."> after gunzip")
+     elseif sname =~ '\.lzma$'
+"         call Decho("decompress: attempt to gunzip ".sname)
+         exe "silent !unlzma ".sname
+         let sname= substitute(sname,'\.lzma$','','')
+"         call Decho("decompress: new sname<".sname."> after unlzma")
      endif
      
      " distribute archive(.zip, .tar, .vba) contents
--- vim71/runtime/filetype.vim~	2007-07-10 14:36:13.000000000 +0200
+++ vim71/runtime/filetype.vim	2007-07-11 11:35:26.000000000 +0200
@@ -34,7 +34,7 @@ au BufNewFile,BufRead ?\+.in
 " 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\|zip\|tgz\|lzma\|tlz\)$'
 endif
 
 " Function used for patterns that end in a star: don't set the filetype if the
diff -p -up ./runtime/autoload/netrw.vim.lzma_support ./runtime/autoload/netrw.vim
--- ./runtime/autoload/netrw.vim.lzma_support	2008-08-09 14:14:28.000000000 +0200
+++ ./runtime/autoload/netrw.vim	2008-08-27 14:49:59.000000000 +0200
@@ -1362,6 +1362,9 @@ fun! s:NetrwGetFile(readcmd, tfile, meth
    elseif rfile =~ '\.tar\.bz2'
 "    call Decho("handling remote bz2-compressed tar file")
     call tar#Browse(tfile)
+   elseif rfile =~ '\.tar\.lzma'
+"    call Decho("handling remote lzma-compressed tar file")
+    call tar#Browse(tfile) 
    else
 "    call Decho("edit temporary file")
     e!
@@ -7237,7 +7240,7 @@ fun! s:GetTempfile(fname)
   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.lzma'
      let suffix = ".tar".substitute(a:fname,'^.*\(\.[^./]\+\)$','\1','e')
     else
      let suffix = substitute(a:fname,'^.*\(\.[^./]\+\)$','\1','e')
diff -p -up ./runtime/autoload/vimball.vim.lzma_support ./runtime/autoload/vimball.vim
--- ./runtime/autoload/vimball.vim.lzma_support	2008-07-30 22:24:17.000000000 +0200
+++ ./runtime/autoload/vimball.vim	2008-08-27 14:55:40.000000000 +0200
@@ -516,6 +516,11 @@ fun! vimball#Decompress(fname)
    exe "e ".escape(fname,' \')
    call vimball#ShowMesg(s:USAGE,"Source this file to extract it! (:so %)")
 
+  elseif expand("%") =~ '.*\.lzma' && executable("unlzma")
+   exe "!unlzma ".a:fname
+   let fname= substitute(a:fname,'\.lzma$','','')
+   exe "e ".escape(fname,' \')
+   call vimball#ShowMesg(s:USAGE,"Source this file to extract it! (:so %)")
   elseif expand("%") =~ '.*\.zip' && executable("unzip")
    " handle *.zip with unzip
    silent exe "!unzip ".s:Escape(a:fname)