def unpurge(*packages):
 if (not packages):
  return {}
 old = __salt__['pkg.list_pkgs'](purge_desired=True)
 ret = {}
 __salt__['cmd.run'](['dpkg', '--set-selections'], stdin='\\n'.join(['{0} install'.format(x) for x in packages]), python_shell=False, output_loglevel='trace')
 __context__.pop('pkg.list_pkgs', None)
 new = __salt__['pkg.list_pkgs'](purge_desired=True)
 return salt.utils.compare_dicts(old, new)

def unpurge ( * packages ) : if ( not packages ) : return { } old = __salt__ [ 'pkg.list_pkgs' ] ( purge_desired = True ) ret = { } __salt__ [ 'cmd.run' ] ( [ 'dpkg' , '--set-selections' ] , stdin = '\\n' . join ( [ '{0} install' . format ( x ) for x in packages ] ) , python_shell = False , output_loglevel = 'trace' ) __context__ . pop ( 'pkg.list_pkgs' , None ) new = __salt__ [ 'pkg.list_pkgs' ] ( purge_desired = True ) return salt . utils . compare_dicts ( old , new )
change package selection for each package specified to install cli example: .