def add_files_to_zip(zip_file, base_dir, file_list):
  """Pack a list of files into a zip archive, that is already
  opened for writing.

  Args:
    zip_file: An object representing the zip archive.
    base_dir: Base path of all the files in the real file system.
    files: List of file paths to add, all relative to base_dir.
        The zip entries will only contain this componenet of the path.
  """
  for file_path in file_list:
    zip_file.write(base_dir + file_path, file_path)
  return 0