-
Notifications
You must be signed in to change notification settings - Fork 0
/
oe-repos-update
executable file
·88 lines (75 loc) · 1.38 KB
/
oe-repos-update
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#!/bin/sh
# Automate update repos derived from:
# http://gitorious.org/vjaquez-beagleboard/marmita
OEROOT=`pwd`
GIT=`which git` || exit 1
GIT="${GIT} --no-pager"
TARGET=$1
checkout () {
$GIT checkout $1
}
branch () {
$GIT checkout -b $1 $2
}
branch_exists () {
out=$($GIT branch | grep $1)
if [ -z $out ]; then
return 0;
fi
return 1;
}
checkout_maybe_branch () {
cd ${OEROOT}/$1 || return
branch_exists $2
if [ $? == 0 ]; then
branch $2 $3
fi
pull $2
}
checkout_branch () {
cd ${OEROOT}/$1 || return
branch_exists $2
if [ $? != 0 ]; then
$GIT checkout $2
else
echo "Creating development brach: $2"
$GIT checkout -b $2
fi
}
clone () {
$GIT clone $1 $2
}
pull () {
if [ "$1" ]; then
checkout $1
else
checkout "master"
fi
$GIT pull --stat --rebase
}
# $1 - repository url
# $2 - local directory
# $3 - local branch name
clone_or_pull () {
if [ -d ${OEROOT}/$2 ]; then
cd ${OEROOT}/$2 && pull $3
else
cd ${OEROOT} && clone $1 $2
fi
}
#
# clone bitbake
#
clone_or_pull "git://git.openembedded.org/bitbake.git" "bitbake"
#
# Use stable version of bitbake
#
checkout_maybe_branch "bitbake" "1.10" "origin/1.10"
#
# clone OE
#
clone_or_pull "git://git.openembedded.org/openembedded.git" "openembedded" "org.openembedded.dev"
#
# Check out working branch
#
checkout_branch "openembedded" "${TARGET}"