• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/usr/bin/env python3
2# -*- coding: utf-8 -*-
3# Copyright 2020 The ChromiumOS Authors
4# Use of this source code is governed by a BSD-style license that can be
5# found in the LICENSE file.
6
7"""Switch part of the objects file in working set to (possible) bad ones."""
8
9
10import sys
11
12from binary_search_tool.test import common
13
14
15def Main(argv):
16    """Switch part of the objects file in working set to (possible) bad ones."""
17    working_set = common.ReadWorkingSet()
18    objects_file = common.ReadObjectsFile()
19    object_index = common.ReadObjectIndex(argv[1])
20
21    for oi in object_index:
22        working_set[oi] = objects_file[oi]
23
24    common.WriteWorkingSet(working_set)
25
26    return 0
27
28
29if __name__ == "__main__":
30    retval = Main(sys.argv)
31    sys.exit(retval)
32