Search Linux Wireless

[PATCH 10/13] compat-wireless: Selectively apply patches

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

 



Patches are now structured in network/ and drm/ subfolders.
Apply them only if the relevant subsystem is enabled.

Signed-off-by: Ozan Çağlayan <ozancag@xxxxxxxxx>
---
 scripts/admin-update.sh | 49 +++++++++++++++++++++++++++++++------------------
 1 file changed, 31 insertions(+), 18 deletions(-)

diff --git a/scripts/admin-update.sh b/scripts/admin-update.sh
index b5dbc4e..e701406 100755
--- a/scripts/admin-update.sh
+++ b/scripts/admin-update.sh
@@ -143,7 +143,7 @@ nagometer() {
 
 	let CHANGES=$ADD+$DEL
 
-	case $1 in
+	case `dirname $1` in
 	"patches")
 		brag_backport $ORIG_CODE $CHANGES $ADD $DEL
 		;;
@@ -201,6 +201,7 @@ copyDirectories() {
 # These switches determines which drivers to fetch in.
 ENABLE_NETWORK=
 ENABLE_DRM=
+SUBSYSTEMS=
 
 EXTRA_PATCHES="patches"
 REFRESH="n"
@@ -262,6 +263,15 @@ if [ $# -ge 1 ]; then
 	done
 fi
 
+# SUBSYSTEMS is used to select which patches to apply
+if [[ -n "$ENABLE_NETWORK" ]]; then
+	SUBSYSTEMS="network"
+fi
+
+if [[ -n "$ENABLE_DRM" ]]; then
+	SUBSYSTEMS+=" drm"
+fi
+
 # User exported this variable
 if [ -z $GIT_TREE ]; then
 	GIT_TREE="$HOME/linux-next"
@@ -604,25 +614,28 @@ for dir in $EXTRA_PATCHES; do
 	LAST_ELEM=$dir
 done
 
-for dir in $EXTRA_PATCHES; do
-	if [[ ! -d $dir ]]; then
-		echo -e "${RED}Patches: $dir empty, skipping...${NORMAL}\n"
-		continue
-	fi
-	if [[ $LAST_ELEM = $dir && "$REFRESH" = y ]]; then
-		patchRefresh $dir
-	fi
-
-	for i in $(ls -v $dir/*.patch &> /dev/null); 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 subsystem in $SUBSYSTEMS; do
+	for dir in $EXTRA_PATCHES; do
+		PATCHDIR="$dir/$subsystem"
+		if [[ ! -d $PATCHDIR ]]; then
+			echo -e "${RED}Patches: $PATCHDIR empty, skipping...${NORMAL}\n"
+			continue
+		fi
+		if [[ $LAST_ELEM = $dir && "$REFRESH" = y ]]; then
+			patchRefresh $dir
 		fi
+
+		for i in $(ls -v $PATCHDIR/*.patch 2> /dev/null); 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
+		nagometer $PATCHDIR $ORIG_CODE >> $CODE_METRICS
 	done
-	nagometer $dir $ORIG_CODE >> $CODE_METRICS
 done
 
 DIR="$PWD"
-- 
1.7.11.2

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux