tools/bisect_repackage/bisect_repackage.py
def repackage_single_revision(revision_map, verify_run, staging_dir,
                              context, cp_num):
  """Repackages a single Chrome build for manual bisect."""
  archive_name = '%s_%s' %(context.file_prefix, cp_num)
  file_archive = os.path.join(staging_dir, archive_name)
  zip_file_name = '%s.zip' % (file_archive)
  if not download_build(cp_num, revision_map, zip_file_name, context):
    return

  extract_dir = os.path.join(staging_dir, archive_name)
  is_android = context.archive in ['arm', 'arm64']
  files_to_include = CHROME_REQUIRED_FILES.get(context.archive)

  dir_path_in_zip = context.GetExtractedDir()
  extract_file_list = []
  # Only extract required files and directories.
  # And when there is no pattern checking for files.
  if not CHROME_WHITELIST_FILES.get(context.archive):
    for f in files_to_include:
      if f.endswith('/'):
        f += '*'
      extract_file_list.append(os.path.join(dir_path_in_zip, f))

  bisect_repackage_utils.ExtractZip(
      zip_file_name, extract_dir, extract_file_list)
  extracted_folder = os.path.join(extract_dir, dir_path_in_zip)

  if CHROME_WHITELIST_FILES.get(context.archive):
    whitelist_files = get_whitelist_files(extracted_folder, context.archive)
    files_to_include += whitelist_files

  (zip_dir, zip_file, tmp_archive) = make_lightweight_archive(extracted_folder,
                                                              archive_name,
                                                              files_to_include,
                                                              context,
                                                              staging_dir,
                                                              is_android)

  if verify_run:
    verify_chrome_run(zip_dir)
  upload_build(zip_file, context)
  with open('upload_revs.json', 'r+') as rfile:
    update_map = json.load(rfile)
    update_map[str(cp_num)] = 'Done'
    rfile.seek(0)
    json.dump(update_map, rfile)
    rfile.truncate()
  # Removed temporary files created during repackaging process.
  remove_created_files_and_path([zip_file_name],
                                [zip_dir, extract_dir, tmp_archive])
Repackages a single Chrome build for manual bisect.
Repackages a single Chrome build for manual bisect.
Repackages a single Chrome build for manual bisect .
def repackage_single_revision(revision_map, verify_run, staging_dir,
                              context, cp_num):
  archive_name = '%s_%s' %(context.file_prefix, cp_num)
  file_archive = os.path.join(staging_dir, archive_name)
  zip_file_name = '%s.zip' % (file_archive)
  if not download_build(cp_num, revision_map, zip_file_name, context):
    return
  extract_dir = os.path.join(staging_dir, archive_name)
  is_android = context.archive in ['arm', 'arm64']
  files_to_include = CHROME_REQUIRED_FILES.get(context.archive)
  dir_path_in_zip = context.GetExtractedDir()
  extract_file_list = []
  if not CHROME_WHITELIST_FILES.get(context.archive):
    for f in files_to_include:
      if f.endswith('/'):
        f += '*'
      extract_file_list.append(os.path.join(dir_path_in_zip, f))
  bisect_repackage_utils.ExtractZip(
      zip_file_name, extract_dir, extract_file_list)
  extracted_folder = os.path.join(extract_dir, dir_path_in_zip)
  if CHROME_WHITELIST_FILES.get(context.archive):
    whitelist_files = get_whitelist_files(extracted_folder, context.archive)
    files_to_include += whitelist_files
  (zip_dir, zip_file, tmp_archive) = make_lightweight_archive(extracted_folder,
                                                              archive_name,
                                                              files_to_include,
                                                              context,
                                                              staging_dir,
                                                              is_android)
  if verify_run:
    verify_chrome_run(zip_dir)
  upload_build(zip_file, context)
  with open('upload_revs.json', 'r+') as rfile:
    update_map = json.load(rfile)
    update_map[str(cp_num)] = 'Done'
    rfile.seek(0)
    json.dump(update_map, rfile)
    rfile.truncate()
  remove_created_files_and_path([zip_file_name],
                                [zip_dir, extract_dir, tmp_archive])
def repackage_single_revision ( revision_map , verify_run , staging_dir , context , cp_num ) : archive_name = '%s_%s' % ( context . file_prefix , cp_num ) file_archive = os . path . join ( staging_dir , archive_name ) zip_file_name = '%s.zip' % ( file_archive ) if not download_build ( cp_num , revision_map , zip_file_name , context ) : return extract_dir = os . path . join ( staging_dir , archive_name ) is_android = context . archive in [ 'arm' , 'arm64' ] files_to_include = CHROME_REQUIRED_FILES . get ( context . archive ) dir_path_in_zip = context . GetExtractedDir ( ) extract_file_list = [ ] if not CHROME_WHITELIST_FILES . get ( context . archive ) : for f in files_to_include : if f . endswith ( '/' ) : f += '*' extract_file_list . append ( os . path . join ( dir_path_in_zip , f ) ) bisect_repackage_utils . ExtractZip ( zip_file_name , extract_dir , extract_file_list ) extracted_folder = os . path . join ( extract_dir , dir_path_in_zip ) if CHROME_WHITELIST_FILES . get ( context . archive ) : whitelist_files = get_whitelist_files ( extracted_folder , context . archive ) files_to_include += whitelist_files ( zip_dir , zip_file , tmp_archive ) = make_lightweight_archive ( extracted_folder , archive_name , files_to_include , context , staging_dir , is_android ) if verify_run : verify_chrome_run ( zip_dir ) upload_build ( zip_file , context ) with open ( 'upload_revs.json' , 'r+' ) as rfile : update_map = json . load ( rfile ) update_map [ str ( cp_num ) ] = 'Done' rfile . seek ( 0 ) json . dump ( update_map , rfile ) rfile . truncate ( ) remove_created_files_and_path ( [ zip_file_name ] , [ zip_dir , extract_dir , tmp_archive ] )
Repackages a single Chrome build for manual bisect.
Repackages a single Chrome build for manual bisect .
"""Repackages a single Chrome build for manual bisect.""" # Only extract required files and directories. # And when there is no pattern checking for files. # Removed temporary files created during repackaging process.
revision_map
verify_run
staging_dir
context
cp_num