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

Side by Side Diff: setup_links.py

Issue 2496323004: Make setup_links.py not fail if Chromium checkout is missing. (Closed)
Patch Set: Created 4 years, 1 month 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) 2014 The WebRTC project authors. All Rights Reserved. 2 # Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
3 # 3 #
4 # Use of this source code is governed by a BSD-style license 4 # Use of this source code is governed by a BSD-style license
5 # that can be found in the LICENSE file in the root of the source 5 # that can be found in the LICENSE file in the root of the source
6 # tree. An additional intellectual property rights grant can be found 6 # tree. An additional intellectual property rights grant can be found
7 # in the file PATENTS. All contributing project authors may 7 # in the file PATENTS. All contributing project authors may
8 # be found in the AUTHORS file in the root of the source tree. 8 # be found in the AUTHORS file in the root of the source tree.
9 9
10 """Setup links to a Chromium checkout for WebRTC. 10 """Setup links to a Chromium checkout for WebRTC.
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after
500 def is_admin(): 500 def is_admin():
501 try: 501 try:
502 return os.getuid() == 0 502 return os.getuid() == 0
503 except AttributeError: 503 except AttributeError:
504 return ctypes.windll.shell32.IsUserAnAdmin() != 0 504 return ctypes.windll.shell32.IsUserAnAdmin() != 0
505 if is_admin(): 505 if is_admin():
506 logging.warning('WARNING: On Windows, you no longer need run as ' 506 logging.warning('WARNING: On Windows, you no longer need run as '
507 'administrator. Please run with user account privileges.') 507 'administrator. Please run with user account privileges.')
508 508
509 if not os.path.exists(CHROMIUM_CHECKOUT): 509 if not os.path.exists(CHROMIUM_CHECKOUT):
510 logging.error('Cannot find a Chromium checkout at %s. Did you run "gclient ' 510 logging.warning('Cannot find a Chromium checkout at %s. Did you run '
511 'sync" before running this script?', CHROMIUM_CHECKOUT) 511 '"gclient sync" before running this script?',
512 return 2 512 CHROMIUM_CHECKOUT)
513 return 0
513 514
514 links_database = _initialize_database(LINKS_DB) 515 links_database = _initialize_database(LINKS_DB)
515 try: 516 try:
516 symlink_creator = WebRTCLinkSetup(links_database, options.force, 517 symlink_creator = WebRTCLinkSetup(links_database, options.force,
517 options.dry_run, options.prompt) 518 options.dry_run, options.prompt)
518 symlink_creator.CleanupLinks() 519 symlink_creator.CleanupLinks()
519 if not options.clean_only: 520 if not options.clean_only:
520 symlink_creator.CreateLinks(on_bot) 521 symlink_creator.CreateLinks(on_bot)
521 except LinkError as e: 522 except LinkError as e:
522 print >> sys.stderr, e.message 523 print >> sys.stderr, e.message
523 return 3 524 return 3
524 finally: 525 finally:
525 links_database.close() 526 links_database.close()
526 return 0 527 return 0
527 528
528 529
529 if __name__ == '__main__': 530 if __name__ == '__main__':
530 sys.exit(main()) 531 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