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

Unified Diff: scripts/slave/recipe_modules/webrtc/resources/cleanup_symlinks.py

Issue 2484803004: WebRTC: Cleanup symlinks before bot_update (Closed)
Patch Set: Rebased new Win8 and Win10 bots 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 side-by-side diff with in-line comments
Download patch
Index: scripts/slave/recipe_modules/webrtc/resources/cleanup_symlinks.py
diff --git a/scripts/slave/recipe_modules/webrtc/resources/cleanup_symlinks.py b/scripts/slave/recipe_modules/webrtc/resources/cleanup_symlinks.py
new file mode 100755
index 0000000000000000000000000000000000000000..568d574ab5d8e1bf585beb8a0202af8d6c088096
--- /dev/null
+++ b/scripts/slave/recipe_modules/webrtc/resources/cleanup_symlinks.py
@@ -0,0 +1,36 @@
+#!/usr/bin/env python
+# Copyright 2016 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""Script that deletes all symlinks created by setup_links.py in a checkout."""
+
+import os
+import subprocess
+import sys
+
+
+def main(args):
+ if len(args) != 1:
+ print >> sys.stderr, 'Please specify a single directory as an argument.'
+ return 1
+
+ checkout_dir = args[0]
+ if not os.path.isdir(checkout_dir):
+ print 'Cannot find any directory at %s. Skipping cleaning.' % checkout_dir
+ return 0
+
+ setup_links_file = os.path.join(checkout_dir, 'setup_links.py')
+ if not os.path.isfile(setup_links_file):
+ print 'Cannot find %s. Incomplete checkout?' % setup_links_file
+ return 1
+ else:
+ print 'Cleaning up symlinks in %s' % checkout_dir
+ subprocess.check_call([sys.executable, setup_links_file, '--clean-only'],
+ cwd=checkout_dir)
+ return 0
+
+
+
+if __name__ == '__main__':
+ sys.exit(main(sys.argv[1:]))

Powered by Google App Engine
This is Rietveld 408576698