Changes for January 2024

This commit is contained in:
Andy CrossGate Yan 2024-01-21 19:21:46 +08:00
parent de01a6f9a1
commit 5ecf530ffb
2 changed files with 32 additions and 1 deletions

31
apply_patches.sh Normal file
View File

@ -0,0 +1,31 @@
#!/bin/bash
set -e
patches="$(readlink -f -- $1)"
shopt -s nullglob
for project in $(cd $patches; echo *);do
p="$(tr _ / <<<$project |sed -e 's;platform/;;g')"
[ "$p" == build ] && p=build/make
[ "$p" == vendor/hardware/overlay ] && p=vendor/hardware_overlay
[ "$p" == vendor/partner/gms ] && p=vendor/partner_gms
pushd $p
git clean -fdx; git reset --hard
for patch in $patches/$project/*.patch;do
if git apply --check $patch;then
git am $patch
elif patch -f -p1 --dry-run < $patch > /dev/null;then
#This will fail
git am $patch || true
patch -f -p1 < $patch
git add -u
git am --continue
else
echo "Failed applying $patch"
exit 1
fi
done
popd
done

View File

@ -58,7 +58,7 @@ echo ""
apply_patches() { apply_patches() {
echo "Applying patch group ${1}" echo "Applying patch group ${1}"
bash ~/treble_experimentations/apply-patches.sh ./lineage_patches_unified/${1} bash ./lineage_build_unified/apply_patches.sh ./lineage_patches_unified/${1}
} }
prep_device() { prep_device() {