-
Notifications
You must be signed in to change notification settings - Fork 4
/
cm7-apply.sh
executable file
·68 lines (58 loc) · 1.49 KB
/
cm7-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
#!/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 frameworks/base
cdv frameworks/base
echo "### Separate configuration of auto-brightness for button/keyboard backlights http://review.cyanogenmod.com/#/c/14196/"
git fetch http://review.cyanogenmod.com/CyanogenMod/android_frameworks_base refs/changes/96/14196/1 && git cherry-pick FETCH_HEAD
cdb
repo start auto device/samsung/epicmtd
cdv device/samsung/epicmtd
echo '### Restore TW cap light timeout http://review.cyanogenmod.com/#/c/16845/'
git fetch http://review.cyanogenmod.com/CyanogenMod/android_device_samsung_epicmtd refs/changes/45/16845/1 && git cherry-pick FETCH_HEAD
cdb
##### SUCCESS ####
SUCCESS=true
exit 0