#NEWLINE# def is_installed( name ) : #NEWLINE# #INDENT# ret = exec_cmd ( "/usr/bin/dpkg-query -l '{0}'" . format ( name ) ) #NEWLINE# if ( err [ 'returncode' ] != 0 ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# return ( ret [ 'stdout' ] . split ( '\n' ) [ ( - 2 ) ] [ 0 ] == 'i' ) #NEWLINE# #UNINDENT# except IndexError as err : #NEWLINE# #INDENT# log . error ( err ) #NEWLINE# return False