Beispiel #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
Beispiel #2
0
def test_version(args, attempt, tag):
    global tag_names

    # get the OS specific installer
    asset = None
    while len(tag_names) > 0 and not asset:
        print('\nattempt ' + str(attempt) + '] getting installer for  "' + tag +
              '" (release id ' + str(releases[tag]['id']) + ')')
        asset = get_release_asset(tag)
        if not asset:
            return False

    if not args.demo_mode:
        download_dir = tempdir('build-bisect_')
        download_path = os.path.join(download_dir, asset['name'])
        print('- downloading to ' + download_path)
        download(tag, asset['browser_download_url'], download_path)

        install_path = install(download_dir, download_path)
        profile_dir = setup_profile_directory(args)

        print('- running binary')
        run_cmd = get_run_cmd(install_path, profile_dir)
        execute(run_cmd)

    first = True
    while True:
        if not first:
            print('please type either `y` for yes or `n` for no!')
        answer = raw_input('Did this version work?: y/n\n')
        first = False
        if answer == 'y' or answer == 'n':
            break

    return answer == 'y'
Beispiel #3
0
def test_version(args, attempt, tag):
    global tag_names

    # get the OS specific installer
    asset = None
    while len(tag_names) > 0 and not asset:
        print('\nattempt ' + str(attempt) + '] getting installer for  "' +
              tag + '" (release id ' + str(releases[tag]['id']) + ')')
        asset = get_release_asset(tag)
        if not asset:
            return False

    if not args.demo_mode:
        download_dir = tempdir('build-bisect_')
        download_path = os.path.join(download_dir, asset['name'])
        print('- downloading to ' + download_path)
        download(tag, asset['browser_download_url'], download_path)

        install_path = install(download_dir, download_path)
        profile_dir = setup_profile_directory(args)

        print('- running binary')
        run_cmd = get_run_cmd(install_path, profile_dir)
        execute(run_cmd)

    first = True
    while True:
        if not first:
            print('please type either `y` for yes or `n` for no!')
        answer = raw_input('Did this version work?: y/n\n')
        first = False
        if answer == 'y' or answer == 'n':
            break

    return answer == 'y'
Beispiel #4
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
def download_framework(framework):
    filename = framework + ".zip"
    url = FRAMEWORKS_URL + "/" + filename
    download_dir = tempdir(prefix="atom-shell-")
    path = os.path.join(download_dir, filename)

    download("Download " + framework, url, path)
    return path
def download_framework(framework):
    filename = framework + '.zip'
    url = FRAMEWORKS_URL + '/' + filename
    download_dir = tempdir(prefix='electron-')
    path = os.path.join(download_dir, filename)

    download('Download ' + framework, url, path)
    return path
def download_framework(framework):
  filename = framework + '.zip'
  url = FRAMEWORKS_URL + '/' + filename
  download_dir = tempdir(prefix='electron-')
  path = os.path.join(download_dir, filename)

  download('Download ' + framework, url, path)
  return path
Beispiel #8
0
def download_native_mksnapshot(arch):
  if not os.path.exists(os.path.join(VENDOR_DIR,
                                     'native_mksnapshot')):
    tar_name = 'native-mksnapshot.tar.bz2'
    url = '{0}/linux/{1}/{2}/{3}'.format(BASE_URL, arch,
           get_libchromiumcontent_commit(), tar_name)
    download(tar_name, url, os.path.join(SOURCE_ROOT, tar_name))
    subprocess.call(['tar', '-jxf', tar_name, '-C', VENDOR_DIR])
    os.remove(tar_name)
Beispiel #9
0
def download_native_mksnapshot(arch):
    if not os.path.exists(os.path.join(VENDOR_DIR, 'native_mksnapshot')):
        tar_name = 'native-mksnapshot.tar.bz2'
        url = '{0}/linux/{1}/{2}/{3}'.format(BASE_URL, arch,
                                             get_libchromiumcontent_commit(),
                                             tar_name)
        download(tar_name, url, os.path.join(SOURCE_ROOT, tar_name))
        subprocess.call(['tar', '-jxf', tar_name, '-C', VENDOR_DIR])
        os.remove(tar_name)
def download_framework(framework):
  framework_path = os.path.join('frameworks', framework) + '.framework'
  if os.path.exists(framework_path):
    return

  filename = framework + '.framework.zip'
  url = FRAMEWORKS_URL + '/' + filename
  download_dir = tempdir(prefix='atom-shell-')
  path = os.path.join(download_dir, filename)

  download('Download ' + framework, url, path)
  return path
Beispiel #11
0
def download_mips64el_toolchain():
  # Download sysroot image.
  if not os.path.exists(os.path.join(VENDOR_DIR,
                                     'debian_jessie_mips64-sysroot')):
    tar_name = 'debian_jessie_mips64-sysroot.tar.bz2'
    download(tar_name, MIPS64EL_SYSROOT_URL,
             os.path.join(SOURCE_ROOT, tar_name))
    subprocess.call(['tar', '-jxf', tar_name, '-C', VENDOR_DIR])
    os.remove(tar_name)
  # Download toolchain.
  if not os.path.exists(os.path.join(VENDOR_DIR, MIPS64EL_GCC)):
    tar_name = MIPS64EL_GCC + '.tar.gz'
    download(tar_name, MIPS64EL_GCC_URL, os.path.join(SOURCE_ROOT, tar_name))
    subprocess.check_call(['tar', '-xf', tar_name, '-C', VENDOR_DIR])
    os.remove(tar_name)
Beispiel #12
0
def download_mips64el_toolchain():
  # Download sysroot image.
  if not os.path.exists(os.path.join(VENDOR_DIR,
                                     'debian_jessie_mips64-sysroot')):
    tar_name = 'debian_jessie_mips64-sysroot.tar.bz2'
    download(tar_name, MIPS64EL_SYSROOT_URL,
             os.path.join(SOURCE_ROOT, tar_name))
    subprocess.call(['tar', '-jxf', tar_name, '-C', VENDOR_DIR])
    os.remove(tar_name)
  # Download toolchain.
  if not os.path.exists(os.path.join(VENDOR_DIR, MIPS64EL_GCC)):
    tar_name = MIPS64EL_GCC + '.tar.gz'
    download(tar_name, MIPS64EL_GCC_URL, os.path.join(SOURCE_ROOT, tar_name))
    subprocess.check_call(['tar', '-xf', tar_name, '-C', VENDOR_DIR])
    os.remove(tar_name)
def download_files(url, files):
  directory = tempfile.mkdtemp(prefix='electron-tmp')
  result = []
  for optional_f in files:
    required = optional_f['required']
    f = optional_f['filename']
    try:
      result.append(download(f, url + f, os.path.join(directory, f)))
    except Exception:
      if required:
        raise

  return directory, result
Beispiel #14
0
def download_files(url, files):
    directory = tempfile.mkdtemp(prefix='electron-tmp')
    result = []
    for optional_f in files:
        required = optional_f['required']
        f = optional_f['filename']
        try:
            result.append(download(f, url + f, os.path.join(directory, f)))
        except Exception:
            if required:
                raise

    return directory, result
def download_to_temp_dir(url, filename, sha):
    download_dir = tempdir(prefix='electron-')
    file_path = os.path.join(download_dir, filename)
    download(text='Download ' + filename, url=url, path=file_path)
    validate_sha(file_path, sha)
    return file_path
def download_files(url, files):
  directory = tempfile.mkdtemp(prefix='electron-tmp')
  return directory, [
    download(f, url + f, os.path.join(directory, f))
    for f in files
  ]
def download_to_temp_dir(url, filename):
  download_dir = tempdir(prefix='electron-')
  file_path = os.path.join(download_dir, filename)
  download(text='Download ' + filename, url=url, path=file_path)
  return file_path
def download_files(url, files):
    directory = tempfile.mkdtemp(prefix='atom-shell-tmp')
    return directory, [
        download(f, url + f, os.path.join(directory, f)) for f in files
    ]