def CreateFromPackage(self, filename, description, display_name, catalogs):
    """Create package info from a live package stored at filename.

    Args:
      filename: str
      description: str, like "Security update for Foo Software"
      display_name: str, like "Munki Client"
      catalogs: list of str catalog names.
    """
    self.VerifyMunkiInstall()

    args = [self._GetMunkiPath(MAKEPKGINFO), filename]
    args.append('--description=%s' % description)
    if display_name:
      args.append('--displayname=%s' % display_name)
    for catalog in catalogs:
      args.append('--catalog=%s' % catalog)

    if 'PKGS_MUNKI_MAKEPKGINFO' in os.environ:
      args[0] = os.environ['PKGS_MUNKI_MAKEPKGINFO']

    try:
      p = subprocess.Popen(
          args,
          stdin=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
          close_fds=True,
          shell=False)
    except __HOLE__, e:
      raise MunkiInstallError('Cannot execute %s: %s' % (' '.join(args), e))

    (stdout, stderr) = p.communicate(None)
    status = p.poll()

    if status == 0 and stdout and not stderr:
      self.filename = filename
    else:
      raise MunkiError(
          'makepkginfo: exit status %d, stderr=%s' % (status, stderr))

    self.plist = plist.MunkiPackageInfoPlist(stdout)
    try:
      self.plist.Parse()
    except plist.Error, e:
      raise Error(str(e))
dataset/ETHPy150Open google/simian/src/simian/mac/munki/pkgs.py/MunkiPackageInfo.CreateFromPackage