From 377f2af5af678af9240de8880036e8e846a16efc Mon Sep 17 00:00:00 2001 From: Pete Date: Mon, 4 Dec 2023 12:26:56 +0000 Subject: [PATCH] Make reset vendor & undo patches switchable --- src/build.sh | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/build.sh b/src/build.sh index 2af616e..376168e 100755 --- a/src/build.sh +++ b/src/build.sh @@ -172,16 +172,20 @@ for branch in ${BRANCH_NAME//,/ }; do echo ">> [$(date)] Branch: $branch" echo ">> [$(date)] Devices: $devices" - # Remove previous changes of vendor/cm, vendor/lineage and frameworks/base (if they exist) - # TODO: maybe reset everything using https://source.android.com/setup/develop/repo#forall - for path in "vendor/cm" "vendor/lineage" "frameworks/base" "packages/apps/PermissionController" "packages/modules/Permission"; do - if [ -d "$path" ]; then - cd "$path" - git reset -q --hard - git clean -q -fd - cd "$SRC_DIR/$branch_dir" - fi - done + if [ "$RESET_VENDOR_UNDO_PATCHES" = true ]; then + # Remove previous changes of vendor/cm, vendor/lineage and frameworks/base (if they exist) + # TODO: maybe reset everything using https://source.android.com/setup/develop/repo#forall + for path in "vendor/cm" "vendor/lineage" "frameworks/base" "packages/apps/PermissionController" "packages/modules/Permission"; do + if [ -d "$path" ]; then + cd "$path" + git reset -q --hard + git clean -q -fd + cd "$SRC_DIR/$branch_dir" + fi + done + else + echo ">> [$(date)] Resetting vendor and undoing patches disabled" | tee -a "$repo_log" + fi echo ">> [$(date)] (Re)initializing branch repository" | tee -a "$repo_log" if [ "$LOCAL_MIRROR" = true ]; then