From d4e01e71d1c364c70619852059f0af1b7c9599a5 Mon Sep 17 00:00:00 2001 From: "Luis R. Rodriguez" Date: Tue, 13 Dec 2011 11:33:32 -0800 Subject: [PATCH] compat-wireless: copy driver files only if present This modifies admin-update.sh to only copy files over from a driver target directory if files are found. This should avoid a bunch of complaints of copying files from directories that are just placeholders for other folders, as happens with drivers/net/wireless/brcm80211/ which has folders a Makefile, Kconfig but no files there itself: brcmfmac/ brcmsmac/ brcmutil/ include Kconfig Makefile Signed-off-by: Luis R. Rodriguez --- scripts/admin-update.sh | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/scripts/admin-update.sh b/scripts/admin-update.sh index 3e63e51b42a2..1aad4fa2710e 100755 --- a/scripts/admin-update.sh +++ b/scripts/admin-update.sh @@ -350,9 +350,18 @@ done # Drivers in their own directory for i in $DRIVERS; do mkdir -p $i - echo "Copying $GIT_TREE/$i/*.[ch]" - cp $GIT_TREE/$i/*.[ch] $i/ - cp $GIT_TREE/$i/Makefile $i/ + + # -print -quit will just print once, so we don't burden + # this script with searching for further files if one is + # found + FILES_FOUND=$(find $GIT_TREE/$i/ -maxdepth 1 -type f -name \*.[ch] -print -quit | wc -l) + if [ $FILES_FOUND -eq 1 ]; then + echo "Copying $GIT_TREE/$i/*.[ch]" + cp $GIT_TREE/$i/*.[ch] $i/ + fi + if [ -f $GIT_TREE/$i/Makefile ]; then + cp $GIT_TREE/$i/Makefile $i/ + fi if [ -f $GIT_TREE/$i/Kconfig ]; then cp $GIT_TREE/$i/Kconfig $i/ fi -- 2.30.2