@@ -0,0 +1,1506 @@
+#!/usr/bin/env python%0A# Copyright 2014 The Chromium Authors. All rights reserved.%0A# Use of this source code is governed by a BSD-style license that can be%0A# found in the LICENSE file.%0A%0A%22%22%22Make sure all of the per-file *_messages.h OWNERS are consistent%22%22%22%0A%0Aimport os%0Aimport re%0Aimport sys%0A%0Adef main():%0A  file_path = os.path.dirname(__file__);%0A  root_dir = os.path.abspath(os.path.join(file_path, '..', '..'))%0A  owners = collect_owners(root_dir)%0A  all_owners = get_all_owners(owners)%0A  print_missing_owners(owners, all_owners)%0A  return 0%0A%0Adef collect_owners(root_dir):%0A  result = %7B%7D%0A  for root, dirs, files in os.walk(root_dir):%0A    if %22OWNERS%22 in files:%0A      owner_file_path = os.path.join(root, %22OWNERS%22)%0A      owner_set = extract_owners_from_file(owner_file_path)%0A      if owner_set:%0A        result%5Bowner_file_path%5D = owner_set%0A  return result%0A%0Adef extract_owners_from_file(owner_file_path):%0A  result = set()%0A  regexp = re.compile('%5Eper-file.*_messages%5B%5E=%5D*=%5Cs*(.*)@(%5B%5E#%5D*)')%0A  with open(owner_file_path) as f:%0A    for line in f:%0A      match = regexp.match(line)%0A      if match:%0A        result.add(match.group(1).strip())%0A  return result%0A%0Adef get_all_owners(owner_dict):%0A  result = set()%0A  for key in owner_dict:%0A    result = result.union(owner_dict%5Bkey%5D)%0A  return result%0A%0Adef print_missing_owners(owner_dict, owner_set):%0A  for key in owner_dict:%0A    for owner in owner_set:%0A      if not owner in owner_dict%5Bkey%5D:%0A        print key + %22 is missing %22 + owner%0A%0Aif '__main__' == __name__:%0A  sys.exit(main())%0A

Add script to tools/security to check consistency of message file owners.