Пример #1
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'
Пример #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'
Пример #3
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
Пример #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
Пример #5
0
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
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):
  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
Пример #9
0
def main():
    parser = argparse.ArgumentParser()
    parser.add_argument('--output', help='Path to output archive.')
    parser.add_argument('--input', help='Path to input archive.')
    parser.add_argument('--target_dir',
                        help='If provided, the paths in the archive will be '
                        'relative to this directory',
                        default='.')
    args = parser.parse_args()

    temp_dir = tempdir('brave_archive')
    lzma_exec = GetLZMAExec()
    cmd = [lzma_exec, 'x', args.input, '-y', '-o' + temp_dir]
    subprocess.check_call(cmd, stdout=subprocess.PIPE, shell=False)
    with scoped_cwd(os.path.join(temp_dir, args.target_dir)):
        make_zip(args.output, [], ['.'])
Пример #10
0
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_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