Upgrade gadgets when they change
This adds a --upgrade option to install_gadget.py and makes VimspectorUpdate only update things which have changed. To do this, we record the gadget spec in a manfiest file and compare it with the current spec when in upgrade mode. 'Changed' in this case means that the gadget spec has changed from the last time the installer was run. It does _not_ actually check the presence of the gadget.
This commit is contained in:
parent
56418e3233
commit
f9d20b9537
5 changed files with 162 additions and 70 deletions
|
|
@ -69,6 +69,10 @@ parser.add_argument( '--force-all',
|
|||
action = 'store_true',
|
||||
help = 'Enable all unsupported completers' )
|
||||
|
||||
parser.add_argument( '--upgrade',
|
||||
action = 'store_true',
|
||||
help = 'Only update adapters changed from the manifest' )
|
||||
|
||||
parser.add_argument( '--quiet',
|
||||
action = 'store_true',
|
||||
help = 'Suppress installation output' )
|
||||
|
|
@ -175,6 +179,7 @@ failed = []
|
|||
succeeded = []
|
||||
all_adapters = installer.ReadAdapters(
|
||||
read_existing = args.update_gadget_config )
|
||||
manifest = installer.Manifest()
|
||||
|
||||
for name, gadget in gadgets.GADGETS.items():
|
||||
if not gadget.get( 'enabled', True ):
|
||||
|
|
@ -187,15 +192,27 @@ for name, gadget in gadgets.GADGETS.items():
|
|||
if getattr( args, 'disable_' + gadget[ 'language' ] ):
|
||||
continue
|
||||
|
||||
if not args.upgrade:
|
||||
manifest.Clear( name )
|
||||
|
||||
installer.InstallGagdet( name,
|
||||
gadget,
|
||||
manifest,
|
||||
succeeded,
|
||||
failed,
|
||||
all_adapters )
|
||||
|
||||
|
||||
for name, gadget in CUSTOM_GADGETS.items():
|
||||
installer.InstallGagdet( name, gadget, succeeded, failed, all_adapters )
|
||||
if not args.upgrade:
|
||||
manifest.Clear( name )
|
||||
|
||||
installer.InstallGagdet( name,
|
||||
gadget,
|
||||
manifest,
|
||||
succeeded,
|
||||
failed,
|
||||
all_adapters )
|
||||
|
||||
if args.no_gadget_config:
|
||||
print( "" )
|
||||
|
|
@ -204,6 +221,8 @@ if args.no_gadget_config:
|
|||
else:
|
||||
installer.WriteAdapters( all_adapters )
|
||||
|
||||
manifest.Write()
|
||||
|
||||
if args.basedir:
|
||||
print( "" )
|
||||
print( "***NOTE***: You set --basedir to " + args.basedir +
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue