]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Don't use xhpast binary to compute xhpastlinter cache version if the binary doesn...
authorepriestley <git@epriestley.com>
Wed, 23 Jan 2013 01:16:37 +0000 (17:16 -0800)
committerepriestley <git@epriestley.com>
Wed, 23 Jan 2013 01:16:37 +0000 (17:16 -0800)
Summary: The binary may not be built, in which case this raises a warning.

Test Plan: Will make @zeeg test.

Reviewers: zeeg, vrana

Reviewed By: vrana

CC: aran
Differential Revision: https://secure.phabricator.com/D4569

src/lint/linter/ArcanistXHPASTLinter.php

index ce5b3062ae6248c23001e2df731fb697ad27d3c0..8c19dab552b1ff9af27414593cadbf1540f8712f 100644 (file)
@@ -156,7 +156,12 @@ final class ArcanistXHPASTLinter extends ArcanistLinter {
   }
 
   public function getCacheVersion() {
-    return '2-'.md5_file(xhpast_get_binary_path());
+    $version = '2';
+    $path = xhpast_get_binary_path();
+    if (Filesystem::pathExists($path)) {
+      $version .= '-'.md5_file($path);
+    }
+    return $version;
   }
 
   public function lintPath($path) {