forked from RisingOSS-devices/android_device_phh_treble
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathunpatch.sh
More file actions
executable file
·27 lines (20 loc) · 740 Bytes
/
Copy pathunpatch.sh
File metadata and controls
executable file
·27 lines (20 loc) · 740 Bytes
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
#!/bin/bash
TOP=$(pwd)
PATCHES=$TOP/device/phh/treble/patches
function unpatch() {
cd $TOP/$2
git reset --hard FETCH_HEAD
echo "removing patches from $SOURCEPATH"
}
function getPatch() {
for FOLDER in $PATCHES/TrebleDroid/*; do
PATCHDIR=$(basename "$FOLDER") # Remove additional path from DIR name
SOURCEPATH=${PATCHDIR/platform_/} # Remove platform_ from dir name
SOURCEPATH=${SOURCEPATH//_//} # replace _ with / to make a path to directory to patch
if [ $SOURCEPATH == "build" ]; then SOURCEPATH="build/make"; fi # Replace build with build/make
if [ $SOURCEPATH == "treble/app" ]; then SOURCEPATH="treble_app"; fi
unpatch $FOLDER $SOURCEPATH
done
cd $TOP
}
getPatch