parameters: (distro, arch, spec, where)
docstring: Unpack the tarfile for (distro, arch, spec) into directory where.
docstring_summary: Unpack the tarfile for (distro, arch, spec) into directory where.
docstring_tokens: Unpack the tarfile for ( distro arch spec ) into directory where .
function: def unpack_binaries_into(distro, arch, spec, where):
      """Unpack the tarfile for (distro, arch, spec) into directory where."""
      rootdir=os.getcwd()
      ensure_dir(where)
      # Note: POSIX tar doesn't require support for gtar's "-C" option,
      # and Python's tarfile module prior to Python 2.7 doesn't have the
      # features to make this detail easy.  So we'll just do the dumb
      # thing and chdir into where and run tar there.
      os.chdir(where)
      try:
          sysassert(["tar", "xvzf", rootdir+"/"+tarfile(distro, arch, spec), "mongodb-linux-%s-subscription-%s-%s/bin" % (arch, distro.build_os(), spec.version())])
          os.rename("mongodb-linux-%s-subscription-%s-%s/bin" % (arch, distro.build_os(), spec.version()), "bin")
          os.rmdir("mongodb-linux-%s-subscription-%s-%s" % (arch, distro.build_os(), spec.version()))
      except Exception:
          exc=sys.exc_value
          os.chdir(rootdir)
          raise exc
      os.chdir(rootdir)
function_tokens: def unpack_binaries_into ( distro , arch , spec , where ) : rootdir = os . getcwd ( ) ensure_dir ( where ) # Note: POSIX tar doesn't require support for gtar's "-C" option, # and Python's tarfile module prior to Python 2.7 doesn't have the # features to make this detail easy.  So we'll just do the dumb # thing and chdir into where and run tar there. os . chdir ( where ) try : sysassert ( [ "tar" , "xvzf" , rootdir + "/" + tarfile ( distro , arch , spec ) , "mongodb-linux-%s-subscription-%s-%s/bin" % ( arch , distro . build_os ( ) , spec . version ( ) ) ] ) os . rename ( "mongodb-linux-%s-subscription-%s-%s/bin" % ( arch , distro . build_os ( ) , spec . version ( ) ) , "bin" ) os . rmdir ( "mongodb-linux-%s-subscription-%s-%s" % ( arch , distro . build_os ( ) , spec . version ( ) ) ) except Exception : exc = sys . exc_value os . chdir ( rootdir ) raise exc os . chdir ( rootdir )