linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Ozan Çağlayan" <ozancag@gmail.com>
To: linux-wireless@vger.kernel.org
Cc: "Ozan Çağlayan" <ozancag@gmail.com>
Subject: [PATCH 10/13] compat-wireless: Selectively apply patches
Date: Thu,  9 Aug 2012 21:01:29 +0300	[thread overview]
Message-ID: <1344535292-4451-11-git-send-email-ozancag@gmail.com> (raw)
In-Reply-To: <1344535292-4451-1-git-send-email-ozancag@gmail.com>

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@gmail.com>
---
 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


  parent reply	other threads:[~2012-08-09 18:02 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-09 18:01 [PATCH 00/13] Merge GSoC DRM changes to admin-update.sh Ozan Çağlayan
2012-08-09 18:01 ` [PATCH 01/13] compat-wireless: Clean up *.mod.c once after everything Ozan Çağlayan
2012-08-09 18:01 ` [PATCH 02/13] compat-wireless: Isolate drivers into different groups Ozan Çağlayan
2012-08-09 18:01 ` [PATCH 03/13] compat-wireless: List everything vertically without concatenating Ozan Çağlayan
2012-08-09 18:01 ` [PATCH 04/13] compat-wireless: Add ability to enable/disable subsystems Ozan Çağlayan
2012-08-09 18:01 ` [PATCH 05/13] compat-wireless: Add 2 convenience functions Ozan Çağlayan
2012-08-09 18:01 ` [PATCH 06/13] compat-wireless: Conditionally build network drivers Ozan Çağlayan
2012-08-09 18:50   ` Hauke Mehrtens
2012-08-10 11:42     ` Ozan Çağlayan
2012-08-09 18:01 ` [PATCH 08/13] compat-wireless: No need to search for patches Ozan Çağlayan
2012-08-09 18:01 ` [PATCH 09/13] compat-wireless: Fix cmdline parameter's name Ozan Çağlayan
2012-08-09 18:01 ` Ozan Çağlayan [this message]
2012-08-09 19:00   ` [PATCH 10/13] compat-wireless: Selectively apply patches Hauke Mehrtens
2012-08-10 11:44     ` Ozan Çağlayan
2012-08-09 18:01 ` [PATCH 11/13] compat-wireless: Move refresh logic into the loop Ozan Çağlayan
2012-08-09 18:01 ` [PATCH 12/13] compat-wireless: Fetch in DRM drivers Ozan Çağlayan
2012-08-09 18:01 ` [PATCH 13/13] compat-wireless: Add DRM patches Ozan Çağlayan
2012-08-09 18:29 ` [PATCH 00/13] Merge GSoC DRM changes to admin-update.sh Sedat Dilek
2012-08-09 18:36   ` Sedat Dilek
2012-08-09 18:43     ` Hauke Mehrtens

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1344535292-4451-11-git-send-email-ozancag@gmail.com \
    --to=ozancag@gmail.com \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).