Strip leading / from source paths in classpath
In Gitiles, buck audit classpath returns entries like:
buck-out/gen/gitiles-servlet/lib__servlet__output/servlet.jar
Prior to this change, matching the provided regex results in a group
like:
/gitiles-servlet
We then check for the existence of '/gitiles-servlet/src/main' et
al., which of course fails since this looks like an absolute path.
This regex previously didn't capture the leading '/', but was changed
to do so in Ib50d37c1. Now that it does, we need to strip that before
doing any path existence checks.
Change-Id: I3bd95c1c63db56a5392c3ab56e9715cfc5c7b6a3
diff --git a/tools/eclipse.py b/tools/eclipse.py
index 7866c78..502d234 100755
--- a/tools/eclipse.py
+++ b/tools/eclipse.py
@@ -91,7 +91,7 @@
for p in query_classpath(MAIN):
m = java_library.match(p)
if m:
- src.add(m.group(1))
+ src.add(m.group(1).lstrip('/'))
else:
lib.add(p)