Browse Source

Merge 4d011b7dc7 into 6497e37694

pull/558/merge
Christopher Clements 9 years ago
committed by GitHub
parent
commit
cac8ec1b8d
4 changed files with 80 additions and 1 deletions
  1. +12
    -0
      autoload/vundle/config.vim
  2. +16
    -1
      autoload/vundle/installer.vim
  3. +31
    -0
      autoload/vundle/scripts.vim
  4. +21
    -0
      doc/vundle.txt

+ 12
- 0
autoload/vundle/config.vim View File

@ -18,6 +18,18 @@ func! vundle#config#bundle(arg, ...)
call s:rtp_add_a() call s:rtp_add_a()
call s:rtp_add_defaults() call s:rtp_add_defaults()
endif endif
if !exists('g:vundle_no_deps') || !g:vundle_no_deps
let deps = vundle#scripts#getdeps(bundle)
if !empty(deps)
for dependency in deps
if !has_key(g:bundle_names, dependency)
call vundle#config#bundle(dependency)
endif
endfor
endif
endif
return bundle return bundle
endf endf


+ 16
- 1
autoload/vundle/installer.vim View File

@ -36,7 +36,7 @@ func! vundle#installer#new(bang, ...) abort
endf endf
" ---------------------------------------------------------------------------
" ---------------------------------------------------------------------------dep
" Iterate over all lines in a Vundle window and execute the given command for " Iterate over all lines in a Vundle window and execute the given command for
" every line. Used by the installation and cleaning functions. " every line. Used by the installation and cleaning functions.
" "
@ -456,6 +456,21 @@ func! s:sync(bang, bundle) abort
return 'error' return 'error'
end end
if !exists('g:vundle_no_deps') || !g:vundle_no_deps
let deps = vundle#scripts#getdeps(a:bundle)
if !empty(deps)
for dependency in deps
if !has_key(g:bundle_names, dependency)
let newbundle = vundle#config#bundle(dependency)
call s:log("Dependency '" . dependency . "'")
if (s:sync(a:bang, newbundle) == 'error')
return 'error'
endif
endif
endfor
endif
endif
if empty(initial_sha) if empty(initial_sha)
return 'new' return 'new'
endif endif


+ 31
- 0
autoload/vundle/scripts.vim View File

@ -277,4 +277,35 @@ func! s:load_scripts(bang)
return eval(readfile(f, 'b')[0]) return eval(readfile(f, 'b')[0])
endf endf
" ---------------------------------------------------------------------------
" Get the dependencies of the given bundle.
"
" bundle -- The bundle to check. (must be installed)
" return -- List of bundle names.
" ---------------------------------------------------------------------------
func! vundle#scripts#getdeps(bundle)
if filereadable(a:bundle['rtpath'] . '/addon-info.json')
let true = 1
let false = 0
let null = ''
let dependencyentries = get(eval(join(readfile(a:bundle['rtpath'] . '/addon-info.json'), '')), 'dependencies', {})
let bundles_needed = []
for dep_name in keys(dependencyentries)
if !empty(dependencyentries[dep_name])
if get(dependencyentries[dep_name], 'type', '') == 'git'
let bundles_needed += [get(dependencyentries[dep_name], 'url', dep_name)]
else
let bundles_needed += [dep_name]
endif
else
let bundles_needed += [dep_name]
endif
endfor
return bundles_needed
else
return []
endif
endf
" vim: set expandtab sts=2 ts=2 sw=2 tw=78 norl: " vim: set expandtab sts=2 ts=2 sw=2 tw=78 norl:

+ 21
- 0
doc/vundle.txt View File

@ -12,6 +12,7 @@
3.5. Searching Plugins |vundle-plugins-search| 3.5. Searching Plugins |vundle-plugins-search|
3.6. Listing Plugins |vundle-plugins-list| 3.6. Listing Plugins |vundle-plugins-list|
3.7. Cleaning Up |vundle-plugins-cleanup| 3.7. Cleaning Up |vundle-plugins-cleanup|
3.8. Dependencies |vundle-plugins-dependencies|
4. Interactive Mode |vundle-interactive| 4. Interactive Mode |vundle-interactive|
5. Key Mappings |vundle-keymappings| 5. Key Mappings |vundle-keymappings|
6. Options |vundle-options| 6. Options |vundle-options|
@ -329,6 +330,20 @@ in your `.vimrc` but present in your bundle installation directory
Automatically confirm removal of unused bundles. Automatically confirm removal of unused bundles.
3.8 DEPENDENCIES ~
*vundle-plugins-dependencies*
By default, Vundle automatically reads plugin dependencies from
`addon-info.json` if it is found in the root of a plugin folder. This aims to
be compatible with vim-addon-manager.
This behavior can be disabled by adding the following line to your `.vimrc`
before the first call to Vundle:
>
let g:vundle_no_deps = 1
<
For more information, see |vundle-options|.
============================================================================= =============================================================================
4. INTERACTIVE MODE ~ 4. INTERACTIVE MODE ~
*vundle-interactive* *vundle-interactive*
@ -382,6 +397,12 @@ KEY | DESCRIPTION
> >
Plugin 'sjl/gundo.vim' -> git@github.com:sjl/gundo.git Plugin 'sjl/gundo.vim' -> git@github.com:sjl/gundo.git
>
let g:vundle_no_deps = 1
<
This option makes Vundle ignore any dependencies stated by a plugin,
preventing these dependencies from being installed automatically.
============================================================================= =============================================================================
7. VUNDLE INTERFACE CHANGE ~ 7. VUNDLE INTERFACE CHANGE ~
*vundle-interface-change* *:Bundle* *:BundleInstall!* *vundle-interface-change* *:Bundle* *:BundleInstall!*


Loading…
Cancel
Save