[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[PATCH 1/2] copy_modules_dir: Take a list of exclusions after the base directory



Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 hook-functions |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/hook-functions b/hook-functions
index 9d59dc1..54fdd67 100644
--- a/hook-functions
+++ b/hook-functions
@@ -183,14 +183,24 @@ copy_exec() {
 copy_modules_dir()
 {
 	local x_mod
+	local exclude
+	local dir="$1"
+	shift
 
-	if ! [ -d "${MODULESDIR}/${1}" ]; then
+	if ! [ -d "${MODULESDIR}/${dir}" ]; then
 		return;
 	fi
 	if [ "${verbose}" = "y" ]; then
-		echo "Copying module directory ${1}"
+		echo "Copying module directory ${dir}"
+		if [ $# -ge 1 ]; then
+		    echo "(excluding $*)"
+		fi
 	fi
-	for x_mod in $(find "${MODULESDIR}/${1}" -name '*.ko' -print); do
+	while [ $# -ge 1 ]; do
+		exclude="$exclude -name $1 -prune -o "
+		shift
+	done
+	for x_mod in $(find "${MODULESDIR}/${dir}" ${exclude} -name '*.ko' -print); do
 		manual_add_modules $(basename ${x_mod} .ko)
 	done
 }
-- 
1.6.5.2


Reply to: