]> git.wh0rd.org - home.git/blame - .bin/cros-repo
improve parallel behavior
[home.git] / .bin / cros-repo
CommitLineData
3c347239 1#!/bin/sh
3c347239
MF
2
3usage() {
4 cat <<-EOF
5f57468d 5 Usage: repo-cros [dir] <command> [command opts]
3c347239
MF
6
7 Commands:
8 int switch to internal tree
9 ext switch to external tree
10 -b <branch> switch branches
11 EOF
12 exit ${1:-1}
13}
14[[ $# -eq 0 ]] && usage
15
5f57468d
MF
16vexec() {
17 cd ${DIR:-~/chromiumos}
18 printf '%s\n%s\n' "${PWD}" "$*"
19 exec "$@"
20}
3c347239 21
5f57468d 22DIR=
3c347239
MF
23while [[ $# -gt 0 ]] ; do
24 case $1 in
25 int) vexec repo init -u ssh://gerrit-int.chromium.org:29419/chromeos/manifest-internal.git --repo-url='http://git.chromium.org/external/repo.git' ;;
26 ext) vexec repo init -u http://git.chromium.org/chromiumos/manifest.git --repo-url http://git.chromium.org/external/repo.git ;;
27 -b) vexec repo init -b $2 ;;
5f57468d
MF
28 *)
29 if [[ -z ${DIR} ]] ; then
30 DIR=$1
31 else
32 usage
33 fi
34 ;;
3c347239 35 esac
5f57468d 36 shift
3c347239
MF
37done
38exit 0