mtd/patches patchin.sh,1.9,1.10

gleixner at infradead.org gleixner at infradead.org
Mon Feb 10 05:55:58 EST 2003


Update of /home/cvs/mtd/patches
In directory phoenix.infradead.org:/tmp/cvs-serv18942

Modified Files:
	patchin.sh 
Log Message:
support debian distros with ancient grep

Index: patchin.sh
===================================================================
RCS file: /home/cvs/mtd/patches/patchin.sh,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- patchin.sh	30 Nov 2002 23:48:39 -0000	1.9
+++ patchin.sh	10 Feb 2003 10:55:55 -0000	1.10
@@ -23,7 +23,8 @@
 #
 # $Id$
 #
-
+# 02-10-2003 tglx replaced grep -m by head -n 1, as older grep versions don't support -m	
+#
 # Keep usage here, easier to find :)
 usage () {
 	echo "usage:  $0 [-j] kernelpath"
@@ -60,9 +61,9 @@
 fi
 
 # Get kernel version
-VERSION=`grep -sm 1 VERSION <$LINUXDIR/Makefile | sed s/'VERSION = '//`
-PATCHLEVEL=`grep -sm 1 PATCHLEVEL <$LINUXDIR/Makefile | sed s/'PATCHLEVEL = '//`
-SUBLEVEL=`grep -sm 1 SUBLEVEL <$LINUXDIR/Makefile | sed s/'SUBLEVEL = '//`
+VERSION=`grep -s VERSION <$LINUXDIR/Makefile | head -n 1 | sed s/'VERSION = '//`
+PATCHLEVEL=`grep -s PATCHLEVEL <$LINUXDIR/Makefile | head -n 1 | sed s/'PATCHLEVEL = '//`
+SUBLEVEL=`grep -s SUBLEVEL <$LINUXDIR/Makefile | head -n 1 | sed s/'SUBLEVEL = '//`
 
 # Can we handle this ?
 if test $VERSION -ne 2 -o $PATCHLEVEL -lt 4
@@ -80,7 +81,7 @@
 # Have we to use ZLIB PATCH ? 
 if [ "$FILESYSTEMS" = "yes" ]
 then
-	PATCHDONE=`grep -s -m 1 zlib_deflate $LINUXDIR/lib/Makefile`
+	PATCHDONE=`grep -s zlib_deflate $LINUXDIR/lib/Makefile | head -n 1`
 	if test $PATCHLEVEL -eq 4 -a $SUBLEVEL -lt 20 
 	then
 		if [ "$PATCHDONE" = "" ] 
@@ -155,15 +156,15 @@
 	ln -sf $TOPDIR/include/linux/jffs.h include/linux
 	ln -sf $JFFS2_H include/linux
 	
-	PATCHDONE=`grep -sm 1 jffs2 fs/Makefile`
+	PATCHDONE=`grep -s jffs2 fs/Makefile | head -n 1`
 	if [ "$PATCHDONE" = "" ]
 	then
 		echo "Add JFFS2 to Makefile and Config.in manually. JFFS2 is included as of 2.4.12"	
 	else
 		if test $PATCHLEVEL -lt 5
 		then
-			JFFS=`grep -nm1 JFFS fs/Config.in | sed s/:.*//`
-			CRAMFS=`grep -nm1 CRAMFS fs/Config.in | sed s/:.*//`
+			JFFS=`grep -n JFFS fs/Config.in | head -n 1 | sed s/:.*//`
+			CRAMFS=`grep -n CRAMFS fs/Config.in | head -n 1 | sed s/:.*//`
 			let JFFS=JFFS-1
 			let CRAMFS=CRAMFS-1
 			sed "$JFFS"q fs/Config.in >Config.tmp
@@ -174,11 +175,11 @@
 			if [ -f include/linux/crc32.h ] 
 			then
 				# check, if it is already defined there
-				CRC32=`grep -sm 1 'crc32(' include/linux/crc32.h`
+				CRC32=`grep -s 'crc32(' include/linux/crc32.h | head -n 1`
 				if [ "$CRC32" = "" ]
 				then
 					# patch in header form fs/jffs2
-					LASTLINE=`grep -nm1 '#endif' include/linux/crc32.h | sed s/:.*//`
+					LASTLINE=`grep -n '#endif' include/linux/crc32.h | head -n 1 | sed s/:.*//`
 					let LASTLINE=LASTLINE-1
 					sed "$LASTLINE"q include/linux/crc32.h >Crc32.tmp
 					cat fs/jffs2/crc32.h >>Crc32.tmp





More information about the linux-mtd-cvs mailing list