def _get_state(pkg):
 cmd = ['opkg', 'status']
 cmd.append(pkg)
 out = __salt__['cmd.run'](cmd, python_shell=False)
 state_flag = ''
 for line in salt.utils.itertools.split(out, '\n'):
  if line.startswith('Status'):
   (_status, _state_want, state_flag, _state_status) = line.split()
 return state_flag

def _get_state ( pkg ) : cmd = [ 'opkg' , 'status' ] cmd . append ( pkg ) out = __salt__ [ 'cmd.run' ] ( cmd , python_shell = False ) state_flag = '' for line in salt . utils . itertools . split ( out , '\n' ) : if line . startswith ( 'Status' ) : ( _status , _state_want , state_flag , _state_status ) = line . split ( ) return state_flag
view package state from the opkg database return the state of pkg .