From: Luis R. Rodriguez Date: Tue, 13 Dec 2011 19:33:32 +0000 (-0800) Subject: compat-wireless: copy driver files only if present X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=d4e01e71d1c364c70619852059f0af1b7c9599a5;p=openwrt%2Fstaging%2Fblogic.git 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 --- 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