From 51a134f00f68195683d2125276cf6c16fd015928 Mon Sep 17 00:00:00 2001 From: "Lance R. Vick" Date: Wed, 9 Sep 2020 04:07:35 -0700 Subject: [PATCH] make patches optional --- scripts/fetch | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/scripts/fetch b/scripts/fetch index 83d2301..93c7a06 100755 --- a/scripts/fetch +++ b/scripts/fetch @@ -24,12 +24,14 @@ mkdir -p "$build_dir" || git clone "$buildroot_repo" "$buildroot_dir" ( cd $buildroot_dir; - git checkout "$buildroot_ref" - git reset --hard - for patch in "${buildroot_external}"/patches/*; do - echo "Applying patch: ${patch}"; - patch -p1 --no-backup-if-mismatch < "${patch}"; - done; + git checkout "$buildroot_ref"; + git reset --hard; + if [ "$(ls -A "${buildroot_external}/patches")" ]; then + for patch in "${buildroot_external}"/patches/*; do + echo "Applying patch: ${patch}"; + patch -p1 --no-backup-if-mismatch < "${patch}"; + done; + fi make "airgap_${target}_defconfig"; make source; ) @@ -38,12 +40,14 @@ mkdir -p "$build_dir" || git clone "$heads_repo" "$heads_dir" ( cd "$heads_dir"; - git checkout "$heads_ref" - git reset --hard - for patch in "${heads_external}"/patches/*; do - echo "Applying patch: ${patch}" - patch -p1 --no-backup-if-mismatch < "${patch}" - done + git checkout "$heads_ref"; + git reset --hard; + if [ "$(ls -A "${heads_external}/patches")" ]; then + for patch in "${heads_external}"/patches/*; do + echo "Applying patch: ${patch}"; + patch -p1 --no-backup-if-mismatch < "${patch}"; + done; + fi rsync -Pav "${heads_external}/boards/" "${heads_dir}/boards/" [[ "$devices" =~ "librem" ]] \ && (cd "$heads_dir/blobs/librem_kbl" && ./get_blobs.sh)