https://pantsbuild.org/ logo
#general
Title
# general
f

full-kilobyte-93429

02/15/2017, 7:55 PM
i thought was a small patch.. this is what i have
Copy code
+  def _relativize_url(self, url):
+    if url:
+      parsed_url = urlparse.urlparse(url)
+      if parsed_url.scheme == 'file' and os.path.isabs(parsed_url.path):
+        return os.path.relpath(parsed_url.path, get_buildroot())
+    return url
+
   def cache_key(self):
     excludes = [(<http://e.org|e.org>, e.name) for e in self.excludes]
     return stable_json_sha1(dict(org=<http://self.org|self.org>,
@@ -96,7 +107,7 @@ class JarDependency(datatype('JarDependency', [
                                  rev=self.rev,
                                  force=self.force,
                                  ext=self.ext,
-                                 url=self.url,
+                                 url=self._relativize_url(self.url),