#NEWLINE# def _get_pkg_ds_avail( ) : #NEWLINE# #INDENT# "\n    Get the package information of the available packages, maintained by dselect.\n    Note, this will be not very useful, if dselect isn't installed.\n\n    :return:\n    " #NEWLINE# avail = '/var/lib/dpkg/available' #NEWLINE# if ( ( not salt . utils . which ( 'dselect' ) ) or ( not os . path . exists ( avail ) ) ) : #NEWLINE# #INDENT# return dict ( ) #NEWLINE# #UNINDENT# ret = dict ( ) #NEWLINE# pkg_mrk = 'Package:' #NEWLINE# pkg_name = 'package' #NEWLINE# for pkg_info in open ( avail ) . read ( ) . split ( pkg_mrk ) : #NEWLINE# #INDENT# nfo = dict ( ) #NEWLINE# for line in ( pkg_mrk + pkg_info ) . split ( os . linesep ) : #NEWLINE# #INDENT# line = line . split ( ': ' , 1 ) #NEWLINE# if ( len ( line ) != 2 ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# ( key , value ) = pkg_name #NEWLINE# if value . strip ( ) : #NEWLINE# #INDENT# nfo [ key . lower ( ) ] = value #NEWLINE# #UNINDENT# #UNINDENT# if nfo . get ( pkg_name ) : #NEWLINE# #INDENT# ret [ nfo [ pkg_name ] ] = nfo #NEWLINE# #UNINDENT# #UNINDENT# return ret