-#!/bin/sh
+#!/bin/bash
usage() {
cat <<-EOF
ext switch to external tree
-b <branch> switch branches (use "master" to get to ToT)
-r <path> patch to reference repo (e.g. ~/chromiumos/)
+ -g <group>
+ -m <manifest>
Operates on the repo in ${PWD}
EOF
REF=
BRANCH=
MANIFEST=
+MANIFEST_NAME=
+GROUPS=()
REPO_URL=
while [[ $# -gt 0 ]] ; do
case $1 in
- depot_tools)
+ depot_tools|dt)
exec git clone https://git.chromium.org/chromium/tools/depot_tools.git
;;
int)
REF=$(realpath "${2:-$(echo ~/chromiumos)}")
shift
;;
+ -g)
+ GROUPS+=( "$2" )
+ shift
+ ;;
+ -m)
+ MANIFEST_NAME="${2%.xml}.xml"
+ shift
+ ;;
*)
usage
;;
${MANIFEST:+-u "${MANIFEST}"} \
${REPO_URL:+--repo-url="${REPO_URL}"} \
${REF:+--reference "${REF}"} \
+ ${MANIFEST_NAME:+-m "${MANIFEST_NAME}"} \
${BRANCH:+-b "${BRANCH}"}
+# ${GROUPS:+-g "${GROUPS[*]}"}
rdir=$(realpath "`pwd`")
while [[ ! -d ${rdir}/.repo ]] ; do