Lines Matching full:path
24 _LOGGER = logging.getLogger(os.path.basename(__file__))
26 # The relative path where official builds are archived in their GS bucket.
43 # (basename, logging name, relative installation path, extraction filter)
55 path = os.path.join(output_dir, _STATE)
56 if not os.path.exists(path):
59 with open(path, 'rb') as f:
60 _LOGGER.debug('Reading state file: %s', path)
70 path = os.path.join(output_dir, _STATE)
71 _LOGGER.debug('Writing state file: %s', path)
74 with open(path, 'wb') as f:
78 def _Md5(path):
79 """Returns the MD5 hash of the file at |path|, which must exist."""
80 return hashlib.md5(open(path, 'rb').read()).hexdigest()
98 _LOGGER.debug('State contents dict contains an invalid path.')
115 abspath = os.path.abspath(os.path.join(output_dir, relpath))
116 if os.path.isfile(abspath):
154 path = os.path.join(output_dir, _STATE)
155 if os.path.getmtime(__file__) > os.path.getmtime(path):
163 def _DirIsEmpty(path):
165 for root, dirs, files in os.walk(path):
169 def _RmTreeHandleReadOnly(func, path, exc):
178 _LOGGER.debug('Removing read-only path: %s', path)
179 os.chmod(path, stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO)
180 func(path)
185 def _RmTree(path):
187 shutil.rmtree(path, ignore_errors=False, onerror=_RmTreeHandleReadOnly)
205 fullpath = os.path.join(output_dir, relpath)
206 fulldir = os.path.dirname(fullpath)
208 if os.path.exists(fullpath):
210 if os.path.isdir(fullpath):
231 if os.path.exists(p) and _DirIsEmpty(p):
240 """Looks for depot_tools and returns the absolute path to gsutil.py."""
241 for path in os.environ['PATH'].split(os.pathsep):
242 path = os.path.abspath(path)
243 git_cl = os.path.join(path, 'git_cl.py')
244 gs_util = os.path.join(path, 'gsutil.py')
245 if os.path.exists(git_cl) and os.path.exists(gs_util):
277 """Downloads the given GS resource to a temporary file, returning its path."""
298 fulldir = os.path.join(options.output_dir, subdir)
299 if os.path.isfile(fulldir):
302 if not os.path.exists(fulldir):
310 path = _Download(resource)
313 with open(path, 'rb') as data:
317 fullpath = os.path.normpath(os.path.join(fulldir, entry.filename))
318 relpath = os.path.relpath(fullpath, options.output_dir)
319 if os.path.exists(fullpath):
325 raise Exception('Path already exists: %s' % fullpath)
336 _LOGGER.debug('Removing temporary file "%s".', path)
337 os.remove(path)
353 help='The path where the binaries will be replaced. Existing binaries '
394 options.output_dir = os.path.normpath(options.output_dir)
407 output_dir = os.path.abspath(options.output_dir)
413 expected_syzygy_dir = os.path.abspath(os.path.join(
414 os.path.dirname(__file__), '..', 'third_party', 'syzygy'))
415 expected_output_dir = os.path.join(expected_syzygy_dir, 'binaries')
420 if not os.path.isdir(expected_syzygy_dir):
424 def OnError(function, path, excinfo):
426 _LOGGER.error('Error when running %s(%s)', function, path, exc_info=excinfo)
468 if os.path.exists(options.output_dir):