aboutsummaryrefslogtreecommitdiff
path: root/share/mk/meta2deps.py
diff options
context:
space:
mode:
authorSimon J. Gerraty <sjg@FreeBSD.org>2013-02-16 01:16:53 +0000
committerSimon J. Gerraty <sjg@FreeBSD.org>2013-02-16 01:16:53 +0000
commit4ed4429c63952b5a92d5f707fa48a42cc2a95e08 (patch)
tree50503f63b789095e8b30b790449ce48f7f2efe97 /share/mk/meta2deps.py
parentb1eb0fa2de44b2b310260739ea462c5f96db7b27 (diff)
downloadsrc-4ed4429c63952b5a92d5f707fa48a42cc2a95e08.tar.gz
src-4ed4429c63952b5a92d5f707fa48a42cc2a95e08.zip
Latest *dirdeps.mk and meta2deps
Notes
Notes: svn path=/projects/bmake/; revision=246865
Diffstat (limited to 'share/mk/meta2deps.py')
-rwxr-xr-xshare/mk/meta2deps.py18
1 files changed, 15 insertions, 3 deletions
diff --git a/share/mk/meta2deps.py b/share/mk/meta2deps.py
index cb6d3213b221..a2bf05b3d3c0 100755
--- a/share/mk/meta2deps.py
+++ b/share/mk/meta2deps.py
@@ -35,9 +35,10 @@ We only pay attention to a subset of the information in the
"""
RCSid:
- $Id: meta2deps.py,v 1.7 2012/11/06 05:44:03 sjg Exp $
+ $Id: meta2deps.py,v 1.8 2013/02/10 19:21:46 sjg Exp $
- Copyright (c) 2011, Juniper Networks, Inc.
+ Copyright (c) 2011-2013, Juniper Networks, Inc.
+ All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
@@ -174,6 +175,8 @@ class MetaFile:
self.debug = getv(conf, 'debug', 0)
self.debug_out = getv(conf, 'debug_out', sys.stderr)
+ self.machine = getv(conf, 'MACHINE', '')
+
if not self.conf:
# some of the steps below we want to do only once
self.conf = conf
@@ -190,6 +193,12 @@ class MetaFile:
self.srctops.append(_srctop)
for objroot in getv(conf, 'OBJROOTS', []):
+ for e in ['/' + self.machine, '/' + self.machine + '/']:
+ if objroot.endswith(e):
+ # this is not what we want - fix it
+ objroot = objroot[0:-len(e)]
+ if e.endswith('/'):
+ objroot += '/'
if not objroot in self.objroots:
self.objroots.append(objroot)
_objroot = os.path.realpath(objroot)
@@ -198,6 +207,10 @@ class MetaFile:
if not _objroot in self.objroots:
self.objroots.append(_objroot)
+ # we want the longest match
+ self.srctops.sort(reverse=True)
+ self.objroots.sort(reverse=True)
+
if self.debug:
print >> self.debug_out, "host_target=", self.host_target
print >> self.debug_out, "srctops=", self.srctops
@@ -206,7 +219,6 @@ class MetaFile:
self.dirdep_re = re.compile(r'([^/]+)/(.+)')
self.curdir = getv(conf, 'CURDIR')
- self.machine = getv(conf, 'MACHINE', '')
self.reldir = getv(conf, 'RELDIR')
self.dpdeps = getv(conf, 'DPDEPS')
if self.dpdeps and not self.reldir: