def upgrade(refresh=True):
 ret = {'changes': {}, 'result': True, 'comment': ''}
 old = list_pkgs()
 if salt.utils.is_true(refresh):
  refresh_db()
 result = _call_brew('brew upgrade', failhard=False)
 __context__.pop('pkg.list_pkgs', None)
 new = list_pkgs()
 ret = salt.utils.compare_dicts(old, new)
 if (result['retcode'] != 0):
  raise CommandExecutionError('Problem encountered upgrading packages', info={'changes': ret, 'result': result})
 return ret

def upgrade ( refresh = True ) : ret = { 'changes' : { } , 'result' : True , 'comment' : '' } old = list_pkgs ( ) if salt . utils . is_true ( refresh ) : refresh_db ( ) result = _call_brew ( 'brew upgrade' , failhard = False ) __context__ . pop ( 'pkg.list_pkgs' , None ) new = list_pkgs ( ) ret = salt . utils . compare_dicts ( old , new ) if ( result [ 'retcode' ] != 0 ) : raise CommandExecutionError ( 'Problem encountered upgrading packages' , info = { 'changes' : ret , 'result' : result } ) return ret
upgrade all packages to the latest possible version .