Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(103)

Side by Side Diff: tools/checkperms/checkperms.py

Issue 1374373007: Make checkperms.py --bare also return failure reason (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Makes sure files have the right permissions. 6 """Makes sure files have the right permissions.
7 7
8 Some developers have broken SCM configurations that flip the executable 8 Some developers have broken SCM configurations that flip the executable
9 permission on for no good reason. Unix developers who run ls --color will then 9 permission on for no good reason. Unix developers who run ls --color will then
10 see .cc files in green and get confused. 10 see .cc files in green and get confused.
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 454
455 if not options.bare: 455 if not options.bare:
456 print('Processed %s files, %d files where tested for shebang/ELF ' 456 print('Processed %s files, %d files where tested for shebang/ELF '
457 'header' % (api.count, api.count_read_header)) 457 'header' % (api.count, api.count_read_header))
458 458
459 if options.json: 459 if options.json:
460 with open(options.json, 'w') as f: 460 with open(options.json, 'w') as f:
461 json.dump(errors, f) 461 json.dump(errors, f)
462 462
463 if errors: 463 if errors:
464 if options.bare: 464 if not options.bare:
465 print '\n'.join(e['full_path'] for e in errors)
466 else:
467 print '\nFAILED\n' 465 print '\nFAILED\n'
468 print '\n'.join('%s: %s' % (e['full_path'], e['error']) for e in errors) 466 print '\n'.join('%s: %s' % (e['full_path'], e['error']) for e in errors)
469 return 1 467 return 1
470 if not options.bare: 468 if not options.bare:
471 print '\nSUCCESS\n' 469 print '\nSUCCESS\n'
472 return 0 470 return 0
473 471
474 472
475 if '__main__' == __name__: 473 if '__main__' == __name__:
476 sys.exit(main()) 474 sys.exit(main())
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698