1#!/usr/bin/env python3 2# -*- coding: utf-8 -*- 3# Copyright 2020 The Chromium OS Authors. All rights reserved. 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 9from __future__ import print_function 10 11import sys 12 13from binary_search_tool.test import common 14 15 16def Main(argv): 17 """Switch part of the objects file in working set to (possible) bad ones.""" 18 working_set = common.ReadWorkingSet() 19 objects_file = common.ReadObjectsFile() 20 object_index = common.ReadObjectIndex(argv[1]) 21 22 for oi in object_index: 23 working_set[oi] = objects_file[oi] 24 25 common.WriteWorkingSet(working_set) 26 27 return 0 28 29 30if __name__ == '__main__': 31 retval = Main(sys.argv) 32 sys.exit(retval) 33