forked from clearlinux/mixer-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate-bundles.sh
executable file
·56 lines (50 loc) · 1.18 KB
/
update-bundles.sh
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
#!/bin/bash
set -e
CLRVER=$(cat "$PWD/.clear-version")
GITREPODIR="$PWD/mix-bundles"
update_repo() {
local repo="$1"
(
if [ ! -d "$repo" ]; then
git clone https://github.com/clearlinux/"$repo.git"
cd "$repo"
else
cd "$repo"
# to force the update of clr-bundles "latest" tag
git fetch --tags
git checkout master
git pull origin master
fi
# checkout the tag relating to the clear version used to build against
git checkout tags/"$CLRVER"
set +e
local branch="${CLRVER}_mix"
git rev-parse --verify "$branch"
if [ $? -eq 0 ]; then
git checkout "$branch"
git pull
else
git checkout -b "$branch"
fi
set -e
cd ..
) &> /dev/null
echo "$repo updated"
}
# Get the upstream clr-bundles
update_repo clr-bundles
# Set up mix bundle repo if it does not exist
if [ ! -d "$GITREPODIR" ]; then
echo "Creating initial $GITREPODIR"
mkdir "$GITREPODIR"
cd "$GITREPODIR"
(
git init .
cp ../clr-bundles/bundles/* .
git add .
git commit -s -m "Setup initial mixer bundles repo"
cd -
) &> /dev/null
fi
exit 0
# vi: ts=8 sw=4 sts=4 et tw=80