Lines Matching refs:path

77 def resolve(path, cwd, last_dir=None, debug=0, debug_out=sys.stderr):
79 Return an absolute path, resolving via cwd or last_dir if needed.
81 if path.endswith('/.'):
82 path = path[0:-2]
83 if len(path) > 0 and path[0] == '/':
84 return path
85 if path == '.':
87 if path.startswith('./'):
88 return cwd + path[1:]
94 p = '/'.join([d,path])
97 if not os.path.exists(p):
107 def abspath(path, cwd, last_dir=None, debug=0, debug_out=sys.stderr):
109 Return an absolute path, resolving via cwd or last_dir if needed.
113 rpath = resolve(path, cwd, last_dir, debug, debug_out)
115 path = rpath
116 if (path.find('/') < 0 or
117 path.find('./') > 0 or
118 path.endswith('/..') or
119 os.path.islink(path)):
120 return os.path.realpath(path)
121 return path
161 RELDIR the relative path from SRCTOP to CURDIR
179 For example if 'some/path/foo.h' is read from SRCTOP
180 then 'DPDEPS_some/path/foo.h +=' "RELDIR" is output.
215 _srctop = os.path.realpath(srctop)
236 _objroot = os.path.realpath(objroot)
308 def find_top(self, path, list):
311 if path.startswith(top):
317 def find_obj(self, objroot, dir, path, input):
318 """return path within objroot, taking care of .dirdep files"""
320 for ddepf in [path + '.dirdep', dir + '/.dirdep']:
321 if not ddep and os.path.exists(ddepf):
363 # Meta data file "path"
372 E "pid" "path"
374 R "pid" "path"
375 W "pid" "path"
377 D "pid" "path"
380 S "pid" "path"
468 path = w[2]
469 self.parse_path(path, cwd, w[0], w)
474 def parse_path(self, path, cwd, op=None, w=[]):
475 """look at a path for the op specified"""
481 if path.endswith('.dirdep'):
484 if p and path.startswith(p):
486 print("exclude:", p, path, file=self.debug_out)
490 path = resolve(path, cwd, self.last_dir, self.debug, self.debug_out)
491 if not path:
493 dir,base = os.path.split(path)
498 # we can have a path in an objdir which is a link
504 # now put path back together
505 path = '/'.join([dir,base])
507 print("raw=%s rdir=%s dir=%s path=%s" % (w[2], rdir, dir, path), file=self.debug_out)
509 if path in [self.last_dir, cwd, self.cwd, self.curdir]:
511 print("skipping:", path, file=self.debug_out)
513 if os.path.isdir(path):
515 self.last_dir = path;
524 srctop = self.find_top(path, self.srctops)
527 self.add(self.file_deps, path.replace(srctop,''), 'file')
545 ddep = self.find_obj(objroot, dir, path, w[2])
685 if not os.path.exists(a):
692 if not os.path.exists(f):