• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/usr/bin/env python2
2"""Change portions of the object files to good.
3
4The "portion" is defined by the file (which is passed as the only argument to
5this script) content. Every line in the file is an object index, which will be
6set to good (mark as 0).
7
8This switch script is made for the noincremental-prune test. This makes sure
9that, after pruning starts (>1 bad item is found), that the number of args sent
10to the switch scripts is equals to the actual number of items (i.e. checking
11that noincremental always holds).
12
13Warning: This switch script assumes the --file_args option
14"""
15
16from __future__ import print_function
17
18import shutil
19import sys
20
21import common
22
23
24def Main(argv):
25  working_set = common.ReadWorkingSet()
26  object_index = common.ReadObjectIndex(argv[1])
27
28  for oi in object_index:
29    working_set[int(oi)] = 0
30
31  shutil.copy(argv[1], './noinc_prune_good')
32
33  common.WriteWorkingSet(working_set)
34
35  return 0
36
37
38if __name__ == '__main__':
39  retval = Main(sys.argv)
40  sys.exit(retval)
41