Don't call realpath on a file that may not exist.
Otherwise realpath prints an error message.
bug: 25658944
Change-Id: I63145c3d955e088e53708d8c6add945e6eab6654
diff --git a/tools/art b/tools/art
index 1394a46..91d6e27 100644
--- a/tools/art
+++ b/tools/art
@@ -30,8 +30,9 @@
}
function find_libdir() {
+ # Get the actual file, $DALVIKVM may be a symbolic link.
# Use realpath instead of readlink because Android does not have a readlink.
- if [ "$(realpath "$ANDROID_ROOT/bin/$DALVIKVM")" = "$(realpath "$ANDROID_ROOT/bin/dalvikvm64")" ]; then
+ if [[ "$(realpath "$ANDROID_ROOT/bin/$DALVIKVM")" == *dalvikvm64 ]]; then
echo "lib64"
else
echo "lib"