def get_selections(pattern=None, state=None):
 ret = {}
 cmd = ['dpkg', '--get-selections']
 cmd.append((pattern if pattern else '*'))
 stdout = __salt__['cmd.run_stdout'](cmd, output_loglevel='trace', python_shell=False)
 ret = _parse_selections(stdout)
 if state:
  return {state: ret.get(state, [])}
 return ret

def get_selections ( pattern = None , state = None ) : ret = { } cmd = [ 'dpkg' , '--get-selections' ] cmd . append ( ( pattern if pattern else '*' ) ) stdout = __salt__ [ 'cmd.run_stdout' ] ( cmd , output_loglevel = 'trace' , python_shell = False ) ret = _parse_selections ( stdout ) if state : return { state : ret . get ( state , [ ] ) } return ret
answers to debconf questions for all packages in the following format:: {package: [[question .