Skip to content
This repository was archived by the owner on Apr 9, 2025. It is now read-only.

Commit 896df37

Browse files
committed
floko: loop smarter
* build -> build_make again Signed-off-by: lindwurm <lindwurm.q@gmail.com>
1 parent 1e1c5e3 commit 896df37

File tree

2 files changed

+24
-42
lines changed

2 files changed

+24
-42
lines changed
File renamed without changes.

floko.sh

Lines changed: 24 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -2,54 +2,36 @@
22
# SPDX-License-Identifier: GPL-3.0-or-later
33

44
build_home="${HOME}/android/floko"
5-
path_to_patches="$(pwd)"
5+
patch_dir="$(pwd)"
66

77
apply_patch() {
8-
echo ">> [$(date)] Applying the patch to $(pwd | sed 's@.*floko/@@g')"
9-
git apply -p1 "${path_to_patches}/${1}.diff"
8+
cd ${build_home}/${1}
9+
echo ">> [$(date)] Applying the patch to ${1}"
10+
patch_file=$(echo ${1} | sed 's@/@_@g')
11+
git apply -p1 "${patch_dir}/${patch_file}.diff"
1012
}
1113

12-
cd ${build_home}/bootable/recovery
13-
apply_patch bootable_recovery
14+
patch_dest_array=(bootable/recovery build/make build/soong frameworks/base lineage-sdk packages/apps/crDroidSettings packages/apps/LineageParts packages/apps/Settings packages/apps/SetupWizard vendor/addons vendor/lineage)
1415

15-
cd ${build_home}/build/make
16-
apply_patch build
16+
for patch_dest in ${patch_dest_array[@]}; do
17+
apply_patch ${patch_dest}
1718

18-
cd ${build_home}/build/soong
19-
apply_patch build_soong
19+
if [ "${patch_dest}" = "frameworks/base" ]; then
20+
# This is workaround; If the patch failed because something changed in upstream, remove this file anyway.
21+
echo ">> [$(date)] -- Removing PixelPropsUtils.java"
22+
git rm core/java/com/android/internal/util/crdroid/PixelPropsUtils.java
2023

21-
cd ${build_home}/frameworks/base
22-
apply_patch frameworks_base
23-
# This is workaround; If the patch failed because something changed in upstream, remove this file anyway.
24-
echo ">> [$(date)] -- Removing PixelPropsUtils.java"
25-
git rm core/java/com/android/internal/util/crdroid/PixelPropsUtils.java
24+
elif [ "${patch_dest}" = "lineage-sdk" ]; then
25+
echo ">> [$(date)] -- Rebranding crDroid to FlokoROM"
26+
find lineage/res/res/values*/strings.xml -type f | xargs sed -i -e "s/crDroid/FlokoROM/g"
2627

27-
cd ${build_home}/lineage-sdk
28-
apply_patch lineage-sdk
29-
echo ">> [$(date)] -- Rebranding crDroid to FlokoROM"
30-
find lineage/res/res/values*/strings.xml -type f | xargs sed -i -e "s/crDroid/FlokoROM/g"
28+
elif [ "${patch_dest}" = "packages/apps/LineageParts" ] || [ "${patch_dest}" = "packages/apps/SetupWizard" ]; then
29+
echo ">> [$(date)] -- Rebranding crDroid to FlokoROM"
30+
find res/values*/strings.xml -type f | xargs sed -i -e "s/crDroid/FlokoROM/g"
3131

32-
cd ${build_home}/packages/apps/crDroidSettings
33-
apply_patch packages_apps_crDroidSettings
34-
35-
cd ${build_home}/packages/apps/LineageParts
36-
apply_patch packages_apps_LineageParts
37-
echo ">> [$(date)] -- Rebranding crDroid to FlokoROM"
38-
find res/values*/strings.xml -type f | xargs sed -i -e "s/crDroid/FlokoROM/g"
39-
40-
cd ${build_home}/packages/apps/Settings
41-
apply_patch packages_apps_Settings
42-
43-
cd ${build_home}/packages/apps/SetupWizard
44-
apply_patch packages_apps_SetupWizard
45-
echo ">> [$(date)] -- Rebranding crDroid to FlokoROM"
46-
find res/values*/strings.xml -type f | xargs sed -i -e "s/crDroid/FlokoROM/g"
47-
48-
cd ${build_home}/vendor/addons
49-
apply_patch vendor_addons
50-
51-
cd ${build_home}/vendor/lineage
52-
apply_patch vendor_lineage
53-
# This is workaround; If the patch failed because something changed in upstream, remove this file anyway.
54-
echo ">> [$(date)] -- Removing version.mk"
55-
git rm config/version.mk
32+
elif [ "${patch_dest}" = "vendor/lineage" ]; then
33+
# This is workaround; If the patch failed because something changed in upstream, remove this file anyway.
34+
echo ">> [$(date)] -- Removing version.mk"
35+
git rm config/version.mk
36+
fi
37+
done

0 commit comments

Comments
 (0)