-
Notifications
You must be signed in to change notification settings - Fork 4
/
apply.sh
executable file
·79 lines (68 loc) · 1.55 KB
/
apply.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/bin/bash
unset SUCCESS
on_exit() {
if [ -z "$SUCCESS" ]; then
echo "ERROR: $0 failed. Please fix the above error."
exit 1
else
echo "SUCCESS: $0 has completed."
exit 0
fi
}
trap on_exit EXIT
http_patch() {
PATCHNAME=$(basename $1)
curl -L -o $PATCHNAME -O -L $1
cat $PATCHNAME |patch -p1
rm $PATCHNAME
}
# Change directory verbose
cdv() {
echo
echo "*****************************"
echo "Current Directory: $1"
echo "*****************************"
cd $BASEDIR/$1
}
# Change back to base directory
cdb() {
cd $BASEDIR
}
# Sanity check
if [ -d ../.repo ]; then
cd ..
fi
if [ ! -d .repo ]; then
echo "ERROR: Must run this script from the base of the repo."
SUCCESS=true
exit 255
fi
# Save Base Directory
BASEDIR=$(pwd)
# Abandon auto topic branch
repo abandon auto
set -e
################ Apply Patches Below ####################
repo start auto bootable/recovery
echo "### patch CWM to backup android_secure on internal and external"
cdv bootable/recovery
git reset --hard
http_patch http://chris41g.devphone.org/patches/nandroid.patch
cdb
repo start auto packages/apps/Phone
echo "### fix ringtones"
cdv packages/apps/Phone
git reset --hard
http_patch http://chris41g.devphone.org/patches/ringer.patch
cdb
repo start auto system/core
echo "### storage"
cdv system/core
git reset --hard
git fetch https://github.com/CyanogenMod/android_system_core refs/heads/jellybean
git cherry-pick be5bb1d4aa98e066c44e5ee8a54a9bf92b17aa37
http_patch http://chris41g.devphone.org/patches/steve.patch
cdb
##### SUCCESS ####
SUCCESS=true
exit 0