Skip to content

Commit

Permalink
config.sh: Enhance skip logic for non-LTS builds
Browse files Browse the repository at this point in the history
Introduces a check for the IS_LTS environment variable to conditionally apply patches based on build type.
Patches containing "_skip_lts" will now be applied during non-LTS builds, even if the filename suggests skipping.

Signed-off-by: taalojarvi <sreedevan05@gmail.com>
  • Loading branch information
taalojarvi committed Jul 1, 2024
1 parent 8dbb7ee commit 5445f91
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,23 @@
PATCH_DIR="../patches"

# Loop through all patch files and apply them
# If the patch filename contains "skip_lts", patch will be ignored
# If the patch filename contains "skip_lts", patch will be ignored.
# The conditional will also check if the build is LTS before skipping and will peacefully ignore the skip tag if it is a non-LTS build.
# TODO(taalojarvi): Expand conditional check to cover skipping patches according to buildtype.
for patch_file in "$PATCH_DIR/"*.patch; do
if [[ ! "$patch_file" =~ _skip_lts ]]; then
if [[ "$IS_LTS" = "NO" ]]; then
echo -e "Patch skip ignored as this is a non LTS build."
echo -e "Applying patch: $patch_file"
git apply "$patch_file"
else
echo -e "Skipping patch: $patch_file"
fi
else
echo -e "Applying patch: $patch_file"
git apply "$patch_file"
else
echo -e "Skipping patch: $patch_file"
fi

# Check for patch conflict (exit code 1)
if [ $? -eq 1 ]; then
echo -e "Patch conflict encountered in $patch_file"
Expand Down

0 comments on commit 5445f91

Please sign in to comment.