From 307c7ceefb0946f105c959881461f6f94c074823 Mon Sep 17 00:00:00 2001 From: "Luis R. Rodriguez" Date: Fri, 19 Feb 2010 17:09:38 -0800 Subject: [PATCH] Skip empty patch directories if one is found. admin-update runs through two patch directories but the linux-next-cherry-picks directory will always be empty for bleeding edge compat-wireless. Signed-off-by: Luis R. Rodriguez --- scripts/admin-update.sh | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/scripts/admin-update.sh b/scripts/admin-update.sh index 6473102a776c..e7f9a1c600a1 100755 --- a/scripts/admin-update.sh +++ b/scripts/admin-update.sh @@ -271,14 +271,20 @@ if [[ "$1" = "refresh" ]]; then patchRefresh linux-next-cherry-picks fi -for i in patches/*.patch linux-next-cherry-picks/*.patch; do - echo -e "${GREEN}Applying backport patch${NORMAL}: ${BLUE}$i${NORMAL}" - patch -p1 -N -t < $i - RET=$? - if [[ $RET -ne 0 ]]; then - echo -e "${RED}Patching $i failed${NORMAL}, update it" - exit $RET +for dir in patches linux-next-cherry-picks; do + FOUND=$(find $dir/ -name \*.patch | wc -l) + if [ $FOUND -eq 0 ]; then + continue fi + for i in $dir/*.patch; do + echo -e "${GREEN}Applying backport patch${NORMAL}: ${BLUE}$i${NORMAL}" + patch -p1 -N -t < $i + RET=$? + if [[ $RET -ne 0 ]]; then + echo -e "${RED}Patching $i failed${NORMAL}, update it" + exit $RET + fi + done done DIR="$PWD" -- 2.30.2