code: def upgrade_available(name):
      '''
      Check if there is an upgrade available for a certain package
  
      CLI Example:
  
      .. code-block:: bash
  
          salt '*' pkgutil.upgrade_available CSWpython
      '''
      version_num = None
      cmd = '/opt/csw/bin/pkgutil -c --parse --single {0}'.format(
          name)
      out = __salt__['cmd.run_stdout'](cmd)
      if out:
          version_num = out.split()[2].strip()
      if version_num:
          if version_num == "SAME":
              return ''
          else:
              return version_num
      return 'f upgrade_available(name):
      '''
      Check if there is an upgrade available for a certain package
  
      CLI Example:
  
      .. code-block:: bash
  
          salt '*' pkgutil.upgrade_available CSWpython
      '''
      version_num = None
      cmd = '/opt/csw/bin/pkgutil -c --parse --single {0}'.format(
          name)
      out = __salt__['cmd.run_stdout'](cmd)
      if out:
          version_num = out.split()[2].strip()
      if version_num:
          if version_num == "SAME":
              return ''
          else:
              return version_num
      return ''
docs: Check if there is an upgrade available for a certain package
  
      CLI Example:
  
      .. code-block:: bash
  
          salt '*' pkgutil.upgrade_available CSWpython