From 3eab41d7c4dacc29cfa50ea55ea53223f01dff7f Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Wed, 12 Apr 2017 15:04:41 -0700 Subject: [PATCH] java dependencies test -s -> use test -d Summary: To correct a build process where the JAVA_TEST_LIBDIR is a symlink to a cache directory. Test -s (size 0) on symlinks returns true, resulting in a mkdir over the top of the symlink resulting in failure. As a solution -d checks if it is a directory (or the symlink refers to a directory), which works in the case of real directories and symlinks to directories. Trivial I know but it was really easy for me to use a symlink here to prevent frequent downloads in a CI environment. Thanks for your consideration. Closes https://github.com/facebook/rocksdb/pull/1917 Differential Revision: D4612263 Pulled By: siying fbshipit-source-id: 4d458f8e1760068cdd6b5eae4bce6e12c400df41 --- java/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/Makefile b/java/Makefile index 33e47a8fd..52e802d5a 100644 --- a/java/Makefile +++ b/java/Makefile @@ -197,7 +197,7 @@ column_family_sample: java $(AM_V_at)@rm -rf /tmp/rocksdbjni resolve_test_deps: - test -s "$(JAVA_TEST_LIBDIR)" || mkdir -p "$(JAVA_TEST_LIBDIR)" + test -d "$(JAVA_TEST_LIBDIR)" || mkdir -p "$(JAVA_TEST_LIBDIR)" test -s "$(JAVA_JUNIT_JAR)" || cp $(MVN_LOCAL)/junit/junit/4.12/junit-4.12.jar $(JAVA_TEST_LIBDIR) || curl -k -L -o $(JAVA_JUNIT_JAR) http://search.maven.org/remotecontent?filepath=junit/junit/4.12/junit-4.12.jar test -s "$(JAVA_HAMCR_JAR)" || cp $(MVN_LOCAL)/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar $(JAVA_TEST_LIBDIR) || curl -k -L -o $(JAVA_HAMCR_JAR) http://search.maven.org/remotecontent?filepath=org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar test -s "$(JAVA_MOCKITO_JAR)" || cp $(MVN_LOCAL)/org/mockito/mockito-all/1.10.19/mockito-all-1.10.19.jar $(JAVA_TEST_LIBDIR) || curl -k -L -o "$(JAVA_MOCKITO_JAR)" http://search.maven.org/remotecontent?filepath=org/mockito/mockito-all/1.10.19/mockito-all-1.10.19.jar