Ejemplo n.º 1
0
def setup_profile_directory(args):
    global is_mac_os

    if is_mac_os:
        print('- processing changes for profile directory')
        if args.real_profile:
            print('-> using real profile (`--real-profile` passed in)')
            return None

        profile_dir = tempdir('build-bisect-profile_')

        if args.use_profile:
            print('-> downloading profile: "' + args.use_profile + '"')
            try:
                filename = os.path.basename(args.use_profile)
                query_string_index = filename.find('?')
                if query_string_index > -1:
                    filename = filename[0:query_string_index]
                download_path = os.path.join(profile_dir, filename)
                download('profile', args.use_profile, download_path)
                if filename.endswith('.zip'):
                    print('-> unzipping to ' + profile_dir)
                    extract_zip(download_path, profile_dir)
            except Exception as e:
                print('whoops- ' + str(e))

        print('-> using profile directory: "' + profile_dir + '"')

        return profile_dir
Ejemplo n.º 2
0
def setup_profile_directory(args):
    global is_mac_os

    if is_mac_os:
        print('- processing changes for profile directory')
        if args.real_profile:
            print('-> using real profile (`--real-profile` passed in)')
            return None

        profile_dir = tempdir('build-bisect-profile_')

        if args.use_profile:
            print('-> downloading profile: "' + args.use_profile + '"')
            try:
                filename = os.path.basename(args.use_profile)
                query_string_index = filename.find('?')
                if query_string_index > -1:
                    filename = filename[0:query_string_index]
                download_path = os.path.join(profile_dir, filename)
                download('profile', args.use_profile, download_path)
                if filename.endswith('.zip'):
                    print('-> unzipping to ' + profile_dir)
                    extract_zip(download_path, profile_dir)
            except Exception as e:
                print('whoops- ' + str(e))

        print('-> using profile directory: "' + profile_dir + '"')

        return profile_dir
Ejemplo n.º 3
0
def main():
    args = parse_args()
    config = parse_config()

    base_url = args.base_url if args.base_url is not None else config['baseUrl']
    version = config['version']
    output_dir = os.path.join(SOURCE_ROOT, 'external_binaries')
    version_file = os.path.join(output_dir, '.version')

    if (is_updated(version_file, version) and not args.force):
        return

    rm_rf(output_dir)
    safe_mkdir(output_dir)

    for binary in config['binaries']:
        if not binary_should_be_downloaded(binary):
            continue

        temp_path = download_binary(base_url, version, binary['url'],
                                    binary['sha'])

        # We assume that all binaries are in zip archives.
        extract_zip(temp_path, output_dir)

        # Hack alert. Set exec bit for sccache binaries.
        # https://bugs.python.org/issue15795
        if 'sccache' in binary['url']:
            add_exec_bit_to_sccache_binary(output_dir)

    with open(version_file, 'w') as f:
        f.write(version)
def main():
  args = parse_args()
  config = parse_config()

  base_url = args.base_url if args.base_url is not None else config['baseUrl']
  version = config['version']
  output_dir = os.path.join(SOURCE_ROOT, 'external_binaries')
  version_file = os.path.join(output_dir, '.version')

  if (is_updated(version_file, version)):
    return

  rm_rf(output_dir)
  safe_mkdir(output_dir)

  for binary in config['binaries']:
    if not binary_should_be_downloaded(binary):
      continue

    temp_path = download_binary(base_url, version, binary['url'])

    # We assume that all binaries are in zip archives.
    extract_zip(temp_path, output_dir)

    # Hack alert. Set exec bit for sccache binaries.
    # https://bugs.python.org/issue15795
    if 'sccache' in binary['url']:
      add_exec_bit_to_sccache_binary(output_dir)

  with open(version_file, 'w') as f:
    f.write(version)
Ejemplo n.º 5
0
def main():
  args = parse_args()
  config = parse_config()

  base_url = args.base_url if args.base_url is not None else config['baseUrl']
  
  output_dir = os.path.join(SOURCE_ROOT, 'external_binaries')
  config_hash_path = os.path.join(output_dir, '.hash')

  if (not is_updated(config_hash_path) and not args.force):
    return

  rm_rf(output_dir)
  safe_mkdir(output_dir)

  for binary in config['files']:
    if not binary_should_be_downloaded(binary):
      continue

    temp_path = download_binary(base_url, binary['sha'], binary['name'])

    if temp_path.endswith('.zip'):
      extract_zip(temp_path, output_dir)
    else:
      tar = tarfile.open(temp_path, "r:gz")
      tar.extractall(output_dir)
      tar.close()

    # Hack alert. Set exec bit for sccache binaries.
    # https://bugs.python.org/issue15795
    if 'sccache' in binary['name']:
      add_exec_bit_to_sccache_binary(output_dir)

  with open(config_hash_path, 'w') as f:
    f.write(sha256(CONFIG_PATH))
Ejemplo n.º 6
0
def download_and_unzip(framework):
    zip_path = download_framework(framework)
    if zip_path:
        extract_zip(zip_path, 'external_binaries')
def download_and_unzip(framework):
  zip_path = download_framework(framework)
  if zip_path:
    extract_zip(zip_path, 'external_binaries')
def download_and_unzip(framework):
  zip_path = download_framework(framework)
  if zip_path:
    extract_zip(zip_path, 'frameworks')
Ejemplo n.º 9
0
def download_and_extract_zip(key, local_dir, bucket, client_config={}):
    util.mkdir_p(local_dir)
    local_zip = os.path.join(local_dir, "zip.zip")
    download_file_from_s3(key, local_zip, bucket, client_config=client_config)
    util.extract_zip(local_zip, delete_zip_file=True)
Ejemplo n.º 10
0
 def download_and_unzip(self, key, local_dir):
     util.mkdir_p(local_dir)
     local_zip = os.path.join(local_dir, "zip.zip")
     self.download_file(key, local_zip)
     util.extract_zip(local_zip, delete_zip_file=True)