Lines Matching refs:path

76 def resolve(path, cwd, last_dir=None, debug=0, debug_out=sys.stderr):
78 Return an absolute path, resolving via cwd or last_dir if needed.
80 if path.endswith('/.'):
81 path = path[0:-2]
82 if len(path) > 0 and path[0] == '/':
83 return path
84 if path == '.':
86 if path.startswith('./'):
87 return cwd + path[1:]
93 p = '/'.join([d,path])
96 if not os.path.exists(p):
106 def abspath(path, cwd, last_dir=None, debug=0, debug_out=sys.stderr):
108 Return an absolute path, resolving via cwd or last_dir if needed.
112 rpath = resolve(path, cwd, last_dir, debug, debug_out)
114 path = rpath
115 if (path.find('/') < 0 or
116 path.find('./') > 0 or
117 path.endswith('/..') or
118 os.path.islink(path)):
119 return os.path.realpath(path)
120 return path
160 RELDIR the relative path from SRCTOP to CURDIR
178 For example if 'some/path/foo.h' is read from SRCTOP
179 then 'DPDEPS_some/path/foo.h +=' "RELDIR" is output.
214 _srctop = os.path.realpath(srctop)
235 _objroot = os.path.realpath(objroot)
307 def find_top(self, path, list):
310 if path.startswith(top):
316 def find_obj(self, objroot, dir, path, input):
317 """return path within objroot, taking care of .dirdep files"""
319 for ddepf in [path + '.dirdep', dir + '/.dirdep']:
320 if not ddep and os.path.exists(ddepf):
362 # Meta data file "path"
371 E "pid" "path"
373 R "pid" "path"
374 W "pid" "path"
376 D "pid" "path"
379 S "pid" "path"
467 path = w[2]
468 self.parse_path(path, cwd, w[0], w)
473 def parse_path(self, path, cwd, op=None, w=[]):
474 """look at a path for the op specified"""
480 if path.endswith('.dirdep'):
483 if p and path.startswith(p):
485 print("exclude:", p, path, file=self.debug_out)
489 path = resolve(path, cwd, self.last_dir, self.debug, self.debug_out)
490 if not path:
492 dir,base = os.path.split(path)
497 # we can have a path in an objdir which is a link
503 # now put path back together
504 path = '/'.join([dir,base])
506 print("raw=%s rdir=%s dir=%s path=%s" % (w[2], rdir, dir, path), file=self.debug_out)
508 if path in [self.last_dir, cwd, self.cwd, self.curdir]:
510 print("skipping:", path, file=self.debug_out)
512 if os.path.isdir(path):
514 self.last_dir = path;
523 srctop = self.find_top(path, self.srctops)
526 self.add(self.file_deps, path.replace(srctop,''), 'file')
544 ddep = self.find_obj(objroot, dir, path, w[2])
684 if not os.path.exists(a):
691 if not os.path.exists(f):