diff options
author | Simon J. Gerraty <sjg@FreeBSD.org> | 2017-04-15 03:28:13 +0000 |
---|---|---|
committer | Simon J. Gerraty <sjg@FreeBSD.org> | 2017-04-15 03:28:13 +0000 |
commit | c0339e7dfd865a9bae874fa128520cfd4bc134b1 (patch) | |
tree | e55e4072497441adf8bcbf69d08c171fe9993d1f /share/mk/meta2deps.py | |
parent | b98582b1469474bb560f6f3f1409449352b63983 (diff) | |
download | src-c0339e7dfd865a9bae874fa128520cfd4bc134b1.tar.gz src-c0339e7dfd865a9bae874fa128520cfd4bc134b1.zip |
Notes
Diffstat (limited to 'share/mk/meta2deps.py')
-rwxr-xr-x | share/mk/meta2deps.py | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/share/mk/meta2deps.py b/share/mk/meta2deps.py index df1eaef0ce42..00eccc1d8d43 100755 --- a/share/mk/meta2deps.py +++ b/share/mk/meta2deps.py @@ -492,6 +492,21 @@ class MetaFile: if not file: f.close() + def is_src(self, base, dir, rdir): + """is base in srctop""" + for dir in [dir,rdir]: + if not dir: + continue + path = '/'.join([dir,base]) + srctop = self.find_top(path, self.srctops) + if srctop: + if self.dpdeps: + self.add(self.file_deps, path.replace(srctop,''), 'file') + self.add(self.src_deps, dir.replace(srctop,''), 'src') + self.seenit(dir) + return True + return False + def parse_path(self, path, cwd, op=None, w=[]): """look at a path for the op specified""" @@ -520,10 +535,9 @@ class MetaFile: # to the src dir, we may need to add dependencies for each rdir = dir dir = abspath(dir, cwd, self.last_dir, self.debug, self.debug_out) - if rdir == dir or rdir.find('./') > 0: - rdir = None - if os.path.islink(dir): rdir = os.path.realpath(dir) + if rdir == dir: + rdir = None # now put path back together path = '/'.join([dir,base]) if self.debug > 1: @@ -544,17 +558,9 @@ class MetaFile: # finally, we get down to it if dir == self.cwd or dir == self.curdir: return - srctop = self.find_top(path, self.srctops) - if srctop: - if self.dpdeps: - self.add(self.file_deps, path.replace(srctop,''), 'file') - self.add(self.src_deps, dir.replace(srctop,''), 'src') + if self.is_src(base, dir, rdir): self.seenit(w[2]) - self.seenit(dir) - if rdir and not rdir.startswith(srctop): - dir = rdir # for below - rdir = None - else: + if not rdir: return objroot = None |