From 8f11e6c9fc2282111ac19fd543aa831919831d50 Mon Sep 17 00:00:00 2001 From: Luca Milanesio Date: Thu, 12 Jun 2014 14:43:06 +0100 Subject: [PATCH] Fix root path resolution for updated Buck Since the last Buck upgraded this morning with [1] the root path resolution is broken. This is due to the different expansion of the __file__ macro into a deeper structure, including the python relative path name inside a PEX directory structure. Example: gerrit/buck-out/bin/tools/maven/mvn.pex/gerrit-extension-api/pom.xml In order to go back to the root package structure and locate the pom.xml file correctly, we need now to go back until the .buckconfig file is found (instead of going back exactly 3 times as it was before). P.S. Without this change the targets api_install and war_install are broken on master. Change-Id: I1a99606ad304c245b21ba501f15c473142a89fc2 --- tools/eclipse/project.py | 2 +- tools/maven/mvn.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/eclipse/project.py b/tools/eclipse/project.py index 50644ebe2d..200831689f 100755 --- a/tools/eclipse/project.py +++ b/tools/eclipse/project.py @@ -32,7 +32,7 @@ JRE = '/'.join([ ]) ROOT = path.abspath(__file__) -for _ in range(0, 3): +while not path.exists(path.join(ROOT, '.buckconfig')): ROOT = path.dirname(ROOT) opts = OptionParser() diff --git a/tools/maven/mvn.py b/tools/maven/mvn.py index 9e36b4839e..6a33bcfe30 100644 --- a/tools/maven/mvn.py +++ b/tools/maven/mvn.py @@ -34,7 +34,7 @@ if not args.v: exit(1) root = path.abspath(__file__) -for _ in range(0, 3): +while not path.exists(path.join(root, '.buckconfig')): root = path.dirname(root) if 'install' == args.a: