forked from AdrianDC/advanced_development_shell_tools
/
android_legacyxperia.rc
executable file
·47 lines (40 loc) · 1.23 KB
/
android_legacyxperia.rc
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
#!/bin/bash
# ======================================
# Developed by Adrian DC - 2015-2016
# ======================================
# === Repo FullSync ===
reposalx()
{
# Phone Branch
BuildBranch="cm-13.0";
if [ ! -z "$1" ]; then BuildBranch="$1"; fi;
# Sources Manifest
if [ ! -f ".repo/local_manifests/semc.xml" ]; then
if [ ! -d "./.repo/local_manifests/" ]; then
mkdir "./.repo/local_manifests";
fi;
cd "./.repo/local_manifests/"
git clone --depth=1 https://github.com/LegacyXperia/local_manifests.git --single-branch -b $BuildBranch .;
cd "../../";
fi;
# Sources Sync
if [[ ! "$2" =~ "nosync" ]]; then
if [[ ! "$2" =~ "unsafe" ]]; then
repo forall -c 'echo "Cleaning project ${REPO_PROJECT}"; \
git rebase --abort >/dev/null 2>&1; \
git stash -u >/dev/null 2>&1; \
git reset --hard HEAD >/dev/null 2>&1;';
fi;
repo sync --current-branch --detach --force-broken --force-sync;
fi;
# Sources Commands
source ./build/envsetup.sh;
# Cherry-picks
./.repo/local_manifests/updates.sh;
# Sync End
echo "";
notify-send "Done syncing !";
echo " =========== Done syncing ===========";
echo "";
}
export -f reposalx;