Permalink
Browse files

Respecting possibility of system-wide VAM installation

Reverted unneeded changes to autoload/vam/install.vim done in last commit
  • Loading branch information...
1 parent 56832c4 commit 88de62fd2587d1304b69da1b3c6eca9e713057cc @ZyX-I ZyX-I committed May 20, 2012
Showing with 10 additions and 6 deletions.
  1. +9 −5 autoload/vam.vim
  2. +1 −1 autoload/vam/install.vim
View
@@ -22,13 +22,13 @@ let s:c['auto_install'] = get(s:c,'auto_install', 0)
" repository locations:
let s:c['plugin_sources'] = get(s:c,'plugin_sources', {})
" if a plugin has an item here the dict value contents will be written as plugin info file
-" adding VAM, so that its contained in list passed to :UpdateActivatedAddons
-let s:c['activated_plugins'] = get(s:c,'activated_plugins', {'vim-addon-manager':{}})
+" Note: VAM itself may be added after definition of vam#PluginDirFromName
+" function
+let s:c['activated_plugins'] = get(s:c,'activated_plugins', {})
let s:c['create_addon_info_handlers'] = get(s:c, 'create_addon_info_handlers', 1)
-" gentoo users may install VAM system wide. In that case s:d is not writeable.
-" In the future this may be put into a gentoo specific patch.
+" Users may install VAM system wide. In that case s:d is not writeable.
let s:d = expand('<sfile>:h:h:h')
let s:c['plugin_root_dir'] = get(s:c, 'plugin_root_dir', filewritable(s:d) ? s:d : '~/.vim/vim-addons' )
unlet s:d
@@ -64,7 +64,6 @@ else
let s:c['plugin_sources']["vim-addon-manager-known-repositories"] = { 'type' : 'archive', 'url': 'http://github.com/MarcWeber/vim-addon-manager-known-repositories/tarball/master', 'archive_name': 'vim-addon-manager-known-repositories-tip.tar.gz' }
endif
-
if s:c.create_addon_info_handlers
augroup VAM_addon_info_handlers
autocmd!
@@ -120,6 +119,11 @@ fun! vam#PluginRuntimePath(name)
return vam#PluginDirFromName(a:name).(has_key(info, 'runtimepath') ? '/'.info['runtimepath'] : '')
endf
+" adding VAM, so that its contained in list passed to :UpdateActivatedAddons
+if filewritable(vam#PluginDirFromName('vim-addon-manager'))==2
+ let s:c['activated_plugins']['vim-addon-manager']=1
+endif
+
" doesn't check dependencies!
fun! vam#IsPluginInstalled(name)
let d = vam#PluginDirFromName(a:name)
View
@@ -370,7 +370,7 @@ fun! vam#install#Update(list)
call vam#install#LoadPool(1)
if empty(list) && s:confirm('Update all loaded plugins?')
- let list = ['vim-addon-manager'] + keys(s:c['activated_plugins'])
+ let list = keys(s:c['activated_plugins'])
endif
let by_reply = {}
for p in list

0 comments on commit 88de62f

Please sign in to comment.