OSDN Git Service

resolved conflicts for merge of 5cc2e94f to master
authorKenny Root <kroot@google.com>
Fri, 15 Jul 2011 22:14:51 +0000 (15:14 -0700)
committerKenny Root <kroot@google.com>
Fri, 15 Jul 2011 22:14:51 +0000 (15:14 -0700)
Change-Id: I7707603ae64fa3e4371fab2e81aab7ec37e69d33

1  2 
envsetup.sh

diff --cc envsetup.sh
@@@ -190,6 -191,97 +190,29 @@@ function settitle(
      fi
  }
  
 -case `uname -s` in
 -    Linux)
 -        function choosesim()
 -        {
 -            echo "Build for the simulator or the device?"
 -            echo "     1. Device"
 -            echo "     2. Simulator"
 -            echo
 -
 -            export TARGET_SIMULATOR=
 -            local ANSWER
 -            while [ -z $TARGET_SIMULATOR ]
 -            do
 -                echo -n "Which would you like? [1] "
 -                if [ -z "$1" ] ; then
 -                    read ANSWER
 -                else
 -                    echo $1
 -                    ANSWER=$1
 -                fi
 -                case $ANSWER in
 -                "")
 -                    export TARGET_SIMULATOR=false
 -                    ;;
 -                1)
 -                    export TARGET_SIMULATOR=false
 -                    ;;
 -                Device)
 -                    export TARGET_SIMULATOR=false
 -                    ;;
 -                2)
 -                    export TARGET_SIMULATOR=true
 -                    ;;
 -                Simulator)
 -                    export TARGET_SIMULATOR=true
 -                    ;;
 -                *)
 -                    echo
 -                    echo "I didn't understand your response.  Please try again."
 -                    echo
 -                    ;;
 -                esac
 -                if [ -n "$1" ] ; then
 -                    break
 -                fi
 -            done
 -
 -            set_stuff_for_environment
 -        }
 -        ;;
 -    *)
 -        function choosesim()
 -        {
 -            echo "Only device builds are supported for" `uname -s`
 -            echo "     Forcing TARGET_SIMULATOR=false"
 -            echo
 -            if [ -z "$1" ]
 -            then
 -                echo -n "Press enter: "
 -                read
 -            fi
 -
 -            export TARGET_SIMULATOR=false
 -            set_stuff_for_environment
 -        }
 -        ;;
 -esac
 -
+ function addcompletions()
+ {
+     local T dir f
+     # Keep us from trying to run in something that isn't bash.
+     if [ -z "${BASH_VERSION}" ]; then
+         return
+     fi
+     # Keep us from trying to run in bash that's too old.
+     if [ ${BASH_VERSINFO[0]} -lt 3 ]; then
+         return
+     fi
+     dir="sdk/bash_completion"
+     if [ -d ${dir} ]; then
+         for f in ${dir}/[a-z]*; do
+             echo "including $f"
+             . $f
+         done
+     fi
+ }
  function choosetype()
  {
      echo "Build type choices are:"