code: def package_installed(self,
  	                      package,
  	                      note=None,
  	                      echo=False,
  	                      loglevel=logging.DEBUG):
  		
  		shutit = self.shutit
  		shutit.handle_note(note)
  		# THIS DOES NOT WORK - WHY? TODO
  		if self.current_environment.install_type == 'apt':
  			#                                v the space is intentional, to avoid polluting bash history.
  			return self.send_and_get_output(' dpkg -s ' + package + """ | grep '^Status: install ok installed' | wc -l""", loglevel=loglevel, echo=echo) == '1'
  		elif self.current_environment.install_type == 'yum':
  			# TODO: check whether it's already installed?. see yum notes  yum list installed "$@" >/dev/null 2>&1
  			self.send(ShutItSendSpec(self,
  			                         send=' yum list installed ' + package + ' >/dev/null 2>&1',
  			                         echo=echo,
  			                         check_exit=False,
  			                         loglevel=loglevel,
  			                         ignore_background=True))
  			return self.check_last_exit_values('install TODO change this',retbool=True)
  		return False
docs: Returns True if we can be sure the package is installed.
  
  		@param package:   Package as a string, eg 'wget'.
  		@param note:      See send()
  
  		@rtype:           boolean