OSDN Git Service

Envsetup: Cygwin doesn't have 'ps -o command'.
authorRaphael Moll <ralf@android.com>
Mon, 20 Jun 2011 23:03:14 +0000 (16:03 -0700)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Wed, 3 Aug 2011 04:38:32 +0000 (12:38 +0800)
Running build/envsetup.sh on cygwin always shows a
warning since there is no 'ps -o command' option.
Bash already sets SHELL=/bin/bash so we can rely on that if present.

Change-Id: I145b42508985735ba61d2b53b216ecc56e321943

envsetup.sh

index abe8b1d..d908216 100644 (file)
@@ -1079,13 +1079,15 @@ function set_java_home() {
     fi
 }
 
-case `ps -o command -p $$` in
-    *bash*)
-        ;;
-    *)
-        echo "WARNING: Only bash is supported, use of other shell would lead to erroneous results"
-        ;;
-esac
+if [ "x$SHELL" != "x/bin/bash" ]; then
+    case `ps -o command -p $$` in
+        *bash*)
+            ;;
+        *)
+            echo "WARNING: Only bash is supported, use of other shell would lead to erroneous results"
+            ;;
+    esac
+fi
 
 # Execute the contents of any vendorsetup.sh files we can find.
 for f in `/bin/ls vendor/*/vendorsetup.sh vendor/*/*/vendorsetup.sh device/*/*/vendorsetup.sh 2> /dev/null`