fix SVN_DEPENDS when .arc is a symlink
@@ -558,7 +558,7 @@ class Build(object):
else:
def find_svn():
for i in range(0, 3):
- for path in (['.svn', 'wc.db'], ['.svn', 'entries'], ['.git', 'logs', 'HEAD'], ['.arc', 'TREE']):
+ for path in (['.svn', 'wc.db'], ['.svn', 'entries'], ['.git', 'logs', 'HEAD']):
path_parts = [os.pardir] * i + path
full_path = os.path.join(self.arcadia.root, *path_parts)
# HACK(somov): No "normpath" here. ymake fails with the "source file name is outside the build tree" error
@@ -566,6 +566,14 @@ class Build(object):
if os.path.exists(full_path):
out_path = os.path.join('${ARCADIA_ROOT}', *path_parts)
return '${input;hide:"%s"}' % out_path
+
+ # Special processing for arc repository since .arc may be a symlink.
+ dot_arc = os.path.realpath(os.path.join(self.arcadia.root, '.arc'))
+ full_path = os.path.join(dot_arc, 'TREE')
+ if os.path.exists(full_path):
+ out_path = os.path.join('${ARCADIA_ROOT}', os.path.relpath(full_path, self.arcadia.root))
+ return '${input;hide:"%s"}' % out_path
+
return ''
emit('SVN_DEPENDS', find_svn())
