summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Hacohen <tom@stosb.com>2013-02-26 17:15:05 +0000
committerTom Hacohen <tom@stosb.com>2013-02-26 17:15:05 +0000
commit73a94c4fedbdcf7d4415d7c738220262134bd5fb (patch)
tree1eb96f815ff32945d7da38c04b8756fa961220dd
Initial commit.
-rw-r--r--README18
-rwxr-xr-xgit_multi.sh72
2 files changed, 90 insertions, 0 deletions
diff --git a/README b/README
new file mode 100644
index 0000000..dec2aba
--- /dev/null
+++ b/README
@@ -0,0 +1,18 @@
1This is a small script that helps pulling, cloning and running arbitrary
2commands in multiple repositories. Designed to help with the EFL.
3
4You should modify the REPOS and DEV_ACCESS at the top of the script before using.
5
6Usage examples:
7Clone all repos:
8./git_multi.sh clone
9
10Update all repos (pull --rebase):
11./git_multi.sh pull
12
13Fetch (without rebasing or merging or anything):
14./git_multi.sh run "git fetch"
15
16Make and install (with sudo):
17./git_multi.sh run "make && sudo make install"
18
diff --git a/git_multi.sh b/git_multi.sh
new file mode 100755
index 0000000..727ed23
--- /dev/null
+++ b/git_multi.sh
@@ -0,0 +1,72 @@
1#!/bin/bash
2
3#Change the list of repos.
4REPOS="core/efl core/enlightenment core/elementary core/evas_generic_loaders"
5#REPOS="legacy/ecore legacy/edbus legacy/edje legacy/eet legacy/eeze legacy/efreet legacy/eina legacy/eio legacy/embryo legacy/emotion legacy/ephysics legacy/ethumb legacy/evas legacy/evil"
6#Change to 1 if you have dev access.
7DEV_ACCESS=0
8
9
10###############################################################################
11# Actual code, don't touch:
12
13usage()
14{
15 echo "Usage : $0 <pull|clone>"
16 exit 1
17}
18
19clone_repos()
20{
21 BASE_URL="git://git.enlightenment.org"
22 if [ "$DEV_ACCESS" -eq 1 ]; then
23 BASE_URL="git+ssh://git@git.enlightenment.org"
24 fi
25
26 echo "Using base URL: '${BASE_URL}'"
27
28 for REPO in $REPOS ; do
29 if [ ! -d "$REPO" ]; then
30 git clone "${BASE_URL}/${REPO}.git $(dirname ${REPO})"
31 else
32 echo "Skipping existing repo: ${REPO}"
33 fi
34 done
35}
36
37run_command_in_dirs()
38{
39 CMD=$1
40 for REPO in $REPOS ; do
41 if [ -d "$REPO" ]; then
42 pushd ${REPO} &>/dev/null
43 $CMD
44 popd &>/dev/null
45 else
46 echo "Skipping non-existent dir: ${REPO}"
47 fi
48 done
49}
50
51if [ $# -lt 1 ]; then
52 usage
53fi
54
55case "$1" in
56 pull)
57 run_command_in_dirs "git pull --rebase"
58 ;;
59 clone)
60 clone_repos
61 ;;
62 run)
63 if [ -z "$2" ]; then
64 echo "'$1' accepts an additional 'command' parameter."
65 exit 1
66 fi
67 run_command_in_dirs "$2"
68 ;;
69 *)
70 usage
71 ;;
72esac