aboutsummaryrefslogtreecommitdiff
path: root/share/mk/meta2deps.py
diff options
context:
space:
mode:
Diffstat (limited to 'share/mk/meta2deps.py')
-rwxr-xr-xshare/mk/meta2deps.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/share/mk/meta2deps.py b/share/mk/meta2deps.py
index 1f1cd8642631..700dc2073b8a 100755
--- a/share/mk/meta2deps.py
+++ b/share/mk/meta2deps.py
@@ -38,7 +38,7 @@ We only pay attention to a subset of the information in the
"""
RCSid:
$FreeBSD$
- $Id: meta2deps.py,v 1.24 2017/02/08 22:17:10 sjg Exp $
+ $Id: meta2deps.py,v 1.27 2017/05/24 00:04:04 sjg Exp $
Copyright (c) 2011-2013, Juniper Networks, Inc.
All rights reserved.
@@ -91,6 +91,12 @@ def resolve(path, cwd, last_dir=None, debug=0, debug_out=sys.stderr):
for d in [last_dir, cwd]:
if not d:
continue
+ if path == '..':
+ dw = d.split('/')
+ p = '/'.join(dw[:-1])
+ if not p:
+ p = '/'
+ return p
p = '/'.join([d,path])
if debug > 2:
print("looking for:", p, end=' ', file=debug_out)
@@ -116,8 +122,11 @@ def cleanpath(path):
if not d or d == '.':
continue
if d == '..':
- p.pop()
- continue
+ try:
+ p.pop()
+ continue
+ except:
+ break
p.append(d)
return r + '/'.join(p)