From owner-svn-src-head@freebsd.org Sat Apr 15 03:28:15 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38272D3E555; Sat, 15 Apr 2017 03:28:15 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E1F5ECBD; Sat, 15 Apr 2017 03:28:14 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3F3SEMM095851; Sat, 15 Apr 2017 03:28:14 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3F3SE8k095850; Sat, 15 Apr 2017 03:28:14 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201704150328.v3F3SE8k095850@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Sat, 15 Apr 2017 03:28:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316952 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 03:28:15 -0000 Author: sjg Date: Sat Apr 15 03:28:13 2017 New Revision: 316952 URL: https://svnweb.freebsd.org/changeset/base/316952 Log: Latest version, we need to realpath anyway to check if an obj dependency is also a src dependency. Modified: head/share/mk/meta2deps.py Modified: head/share/mk/meta2deps.py ============================================================================== --- head/share/mk/meta2deps.py Sat Apr 15 02:24:22 2017 (r316951) +++ head/share/mk/meta2deps.py Sat Apr 15 03:28:13 2017 (r316952) @@ -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