From 5ecf530ffbd5f98ade8f15c0f6b69431d9241d39 Mon Sep 17 00:00:00 2001 From: Andy CrossGate Yan Date: Sun, 21 Jan 2024 19:21:46 +0800 Subject: [PATCH] Changes for January 2024 --- apply_patches.sh | 31 +++++++++++++++++++++++++++++++ buildbot_unified.sh | 2 +- 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 apply_patches.sh diff --git a/apply_patches.sh b/apply_patches.sh new file mode 100644 index 0000000..02395e8 --- /dev/null +++ b/apply_patches.sh @@ -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 + diff --git a/buildbot_unified.sh b/buildbot_unified.sh index c8ca0c1..806fe8a 100755 --- a/buildbot_unified.sh +++ b/buildbot_unified.sh @@ -58,7 +58,7 @@ echo "" apply_patches() { 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() {