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

Side by Side Diff: infra/bots/utils.py

Issue 2085473002: Add CIPD support for bot assets (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Update CIPD to include new pkg-delete command Created 4 years, 6 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 | « infra/bots/tools/luci-go/win64/cipd.exe.sha1 ('k') | 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 # 2 #
3 # Copyright 2016 Google Inc. 3 # Copyright 2016 Google Inc.
4 # 4 #
5 # Use of this source code is governed by a BSD-style license that can be 5 # Use of this source code is governed by a BSD-style license that can be
6 # found in the LICENSE file. 6 # found in the LICENSE file.
7 7
8 8
9 import datetime 9 import datetime
10 import errno 10 import errno
11 import os 11 import os
12 import shutil 12 import shutil
13 import sys 13 import sys
14 import subprocess 14 import subprocess
15 import tempfile 15 import tempfile
16 import time 16 import time
17 import uuid 17 import uuid
18 18
19 19
20 GCLIENT = 'gclient.bat' if sys.platform == 'win32' else 'gclient' 20 GCLIENT = 'gclient.bat' if sys.platform == 'win32' else 'gclient'
21 GIT = 'git.bat' if sys.platform == 'win32' else 'git' 21 GIT = 'git.bat' if sys.platform == 'win32' else 'git'
22 WHICH = 'where' if sys.platform == 'win32' else 'which'
22 23
23 24
24 class print_timings(object): 25 class print_timings(object):
25 def __init__(self): 26 def __init__(self):
26 self._start = None 27 self._start = None
27 28
28 def __enter__(self): 29 def __enter__(self):
29 self._start = datetime.datetime.utcnow() 30 self._start = datetime.datetime.utcnow()
30 print 'Task started at %s GMT' % str(self._start) 31 print 'Task started at %s GMT' % str(self._start)
31 32
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 # For POSIX: making the directory writable guarantees removability. 192 # For POSIX: making the directory writable guarantees removability.
192 # Windows will ignore the non-read-only bits in the chmod value. 193 # Windows will ignore the non-read-only bits in the chmod value.
193 os.chmod(root, 0770) 194 os.chmod(root, 0770)
194 for name in files: 195 for name in files:
195 remove_with_retry(os.remove, os.path.join(root, name)) 196 remove_with_retry(os.remove, os.path.join(root, name))
196 for name in dirs: 197 for name in dirs:
197 remove_with_retry(lambda p: shutil.rmtree(p, onerror=RmTreeOnError), 198 remove_with_retry(lambda p: shutil.rmtree(p, onerror=RmTreeOnError),
198 os.path.join(root, name)) 199 os.path.join(root, name))
199 200
200 remove_with_retry(os.rmdir, file_path) 201 remove_with_retry(os.rmdir, file_path)
OLDNEW
« no previous file with comments | « infra/bots/tools/luci-go/win64/cipd.exe.sha1 ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698