1212" autoloading search path fix
1313" substitution of hardcoded commands with global variables
1414" 2024 Nov 12 by Vim Project: fix problems on Windows (#16036)
15+ " 2025 Feb 28 by Vim Project: add support for bzip3 (#16755)
1516" }}}
1617"
1718" GetLatestVimScripts: 642 1 :AutoInstall: getscript.vim
@@ -100,6 +101,10 @@ if !exists("g:GetLatestVimScripts_bunzip2")
100101 let g: GetLatestVimScripts_bunzip2= " bunzip2"
101102endif
102103
104+ if ! exists (" g:GetLatestVimScripts_bunzip3" )
105+ let g: GetLatestVimScripts_bunzip3= " bunzip3"
106+ endif
107+
103108if ! exists (" g:GetLatestVimScripts_gunzip" )
104109 let g: GetLatestVimScripts_gunzip= " gunzip"
105110endif
@@ -565,73 +570,55 @@ fun! s:GetOneScript(...)
565570 " --------------------------------------------------------------------------
566571" call Decho("checking if plugin requested autoinstall: doautoinstall=".doautoinstall)
567572 if doautoinstall
568- " call Decho(" ")
569- " call Decho("Autoinstall: getcwd<".getcwd()."> filereadable(".sname.")=".filereadable(sname))
570573 if filereadable (sname)
571- " call Decho("<".sname."> is readable")
572- " call Decho("exe silent !".g:GetLatestVimScripts_mv." ".shellescape(sname)." ".shellescape(s:autoinstall))
573574 exe " silent !" .g: GetLatestVimScripts_mv ." " .shellescape (sname)." " .shellescape (s: autoinstall )
574575 let curdir = fnameescape (substitute (getcwd (),' \' ,' /' ,' ge' ))
575576 let installdir= curdir." /Installed"
576577 if ! isdirectory (installdir)
577578 call mkdir (installdir)
578579 endif
579- " call Decho("curdir<".curdir."> installdir<".installdir.">")
580- " call Decho("exe cd ".fnameescape(s:autoinstall))
581580 exe " cd " .fnameescape (s: autoinstall )
582581
583582 " determine target directory for moves
584583 let firstdir= substitute (&rtp ,' ,.*$' ,' ' ,' ' )
585584 let pname = substitute (sname,' \..*' ,' .vim' ,' ' )
586- " call Decho("determine tgtdir: is <".firstdir.'/AsNeeded/'.pname." readable?")
587585 if filereadable (firstdir.' /AsNeeded/' .pname)
588586 let tgtdir= " AsNeeded"
589587 else
590588 let tgtdir= " plugin"
591589 endif
592- " call Decho("tgtdir<".tgtdir."> pname<".pname.">")
593-
590+
594591 " decompress
595592 if sname = ~ ' \.bz2$'
596- " call Decho("decompress: attempt to bunzip2 ".sname)
597593 exe " sil !" .g: GetLatestVimScripts_bunzip2 ." " .shellescape (sname)
598594 let sname= substitute (sname,' \.bz2$' ,' ' ,' ' )
599- " call Decho("decompress: new sname<".sname."> after bunzip2")
595+ elseif sname = ~ ' \.bz3$'
596+ exe " sil !" .g: GetLatestVimScripts_bunzip3 ." " .shellescape (sname)
597+ let sname= substitute (sname,' \.bz3$' ,' ' ,' ' )
600598 elseif sname = ~ ' \.gz$'
601- " call Decho("decompress: attempt to gunzip ".sname)
602599 exe " sil !" .g: GetLatestVimScripts_gunzip ." " .shellescape (sname)
603600 let sname= substitute (sname,' \.gz$' ,' ' ,' ' )
604- " call Decho("decompress: new sname<".sname."> after gunzip")
605601 elseif sname = ~ ' \.xz$'
606- " call Decho("decompress: attempt to unxz ".sname)
607602 exe " sil !" .g: GetLatestVimScripts_unxz ." " .shellescape (sname)
608603 let sname= substitute (sname,' \.xz$' ,' ' ,' ' )
609- " call Decho("decompress: new sname<".sname."> after unxz")
610604 else
611605" call Decho("no decompression needed")
612606 endif
613-
607+
614608 " distribute archive(.zip, .tar, .vba, .vmb, ...) contents
615609 if sname = ~ ' \.zip$'
616- " call Decho("dearchive: attempt to unzip ".sname)
617610 exe " silent !" .g: GetLatestVimScripts_unzip ." -o " .shellescape (sname)
618611 elseif sname = ~ ' \.tar$'
619- " call Decho("dearchive: attempt to untar ".sname)
620612 exe " silent !tar -xvf " .shellescape (sname)
621613 elseif sname = ~ ' \.tgz$'
622- " call Decho("dearchive: attempt to untar+gunzip ".sname)
623614 exe " silent !tar -zxvf " .shellescape (sname)
624615 elseif sname = ~ ' \.taz$'
625- " call Decho("dearchive: attempt to untar+uncompress ".sname)
626616 exe " silent !tar -Zxvf " .shellescape (sname)
627617 elseif sname = ~ ' \.tbz$'
628- " call Decho("dearchive: attempt to untar+bunzip2 ".sname)
629618 exe " silent !tar -jxvf " .shellescape (sname)
630619 elseif sname = ~ ' \.txz$'
631- " call Decho("dearchive: attempt to untar+xz ".sname)
632620 exe " silent !tar -Jxvf " .shellescape (sname)
633621 elseif sname = ~ ' \.vba$\|\.vmb$'
634- " call Decho("dearchive: attempt to handle a vimball: ".sname)
635622 silent 1 split
636623 if exists (" g:vimball_home" )
637624 let oldvimballhome= g: vimball_home
@@ -648,25 +635,21 @@ fun! s:GetOneScript(...)
648635 else
649636" call Decho("no dearchiving needed")
650637 endif
651-
638+
652639 " ---------------------------------------------
653640 " move plugin to plugin/ or AsNeeded/ directory
654641 " ---------------------------------------------
655642 if sname = ~ ' .vim$'
656- " call Decho("dearchive: attempt to simply move ".sname." to ".tgtdir)
657643 exe " silent !" .g: GetLatestVimScripts_mv ." " .shellescape (sname)." " .tgtdir
658644 else
659- " call Decho("dearchive: move <".sname."> to installdir<".installdir.">")
660645 exe " silent !" .g: GetLatestVimScripts_mv ." " .shellescape (sname)." " .installdir
661646 endif
662647 if tgtdir != " plugin"
663- " call Decho("exe silent !".g:GetLatestVimScripts_mv." ".shellescape("plugin/".pname)." ".tgtdir)
664648 exe " silent !" .g: GetLatestVimScripts_mv ." " .shellescape (" plugin/" .pname)." " .tgtdir
665649 endif
666-
650+
667651 " helptags step
668652 let docdir= substitute (&rtp ,' ,.*' ,' ' ,' e' )." /doc"
669- " call Decho("helptags: docdir<".docdir.">")
670653 exe " helptags " .fnameescape (docdir)
671654 exe " cd " .fnameescape (curdir)
672655 endif
@@ -681,13 +664,8 @@ fun! s:GetOneScript(...)
681664
682665 " update the data in the <GetLatestVimScripts.dat> file
683666 call setline (line (" ." ),modline)
684- " call Decho("update data in ".expand("%")."#".line(".").": modline<".modline.">")
685- " else " Decho
686- " call Decho("[latestsrcid=".latestsrcid."] <= [srcid=".srcid."], no need to update")
687667 endif
688668
689- " call Dredir("BUFFER TEST (GetOneScript)","ls!")
690- " call Dret("GetOneScript")
691669endfun
692670
693671" ---------------------------------------------------------------------
0 commit comments