mtd/patches patchin.sh,1.34,1.35

Artem Bityuckiy dedekind at infradead.org
Mon Dec 13 08:00:01 EST 2004


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

Modified Files:
	patchin.sh 
Log Message:
Add -y option which is useful when writing scripts which use patchin.sh


Index: patchin.sh
===================================================================
RCS file: /home/cvs/mtd/patches/patchin.sh,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- patchin.sh	13 Dec 2004 11:52:33 -0000	1.34
+++ patchin.sh	13 Dec 2004 12:59:58 -0000	1.35
@@ -220,12 +220,13 @@
 # Display usage of this script
 #
 usage () {
-	echo "usage:  $0 [-c] [-j] [-2] [-3] [-b] kernelpath"
+	echo "usage:  $0 [-c] [-j] [-2] [-3] [-b] [-y] kernelpath"
 	echo "   -c  -- copy files to kernel tree instead of building links"
 	echo "   -j  -- include JFFS2 file system (depricated option)" 
 	echo "   -2  -- include JFFS2 file system"
 	echo "   -3  -- include JFFS3 file system (experimental, you probably don't want this)"
-	echo "   -b  -- Check files out for write from BK" 
+	echo "   -b  -- check files out for write from BK" 
+	echo '   -y  -- assume "Yes" on any question'
 	exit 1
 }
 
@@ -277,6 +278,7 @@
 CONFIG="Config.in"
 LNCP="ln -sf"
 METHOD="Link"
+ASSUME_YES="no"
 
 # MTD - files and directories
 MTD_DIRS="drivers/mtd drivers/mtd/chips drivers/mtd/devices drivers/mtd/maps drivers/mtd/nand include/linux/mtd include/mtd"
@@ -321,7 +323,7 @@
 #
 
 # Get commandline options
-while getopts cjb23 opt
+while getopts j23cby opt
 do
     case "$opt" in
       j)  JFFS2_FS=yes;;
@@ -329,6 +331,7 @@
       3)  JFFS3_FS=yes;;
       c)  LNCP="cp -f"; METHOD="Copy";;
       b)  BK=yes;;
+      y)  ASSUME_YES="yes";;
       \?)
 	  usage;
     esac
@@ -432,13 +435,14 @@
 echo "RS-Lib-Patch needed: $RSLIBPATCH"
 echo "Documentation Patch needed: $DOCPATCH"
 echo "Method: $METHOD"
-read -p "Can we start now ? [y/N]" ANSWER
-echo ""
 
-if [ "$ANSWER" != "y" ]
-then
-	echo Patching Kernel cancelled
-	exit 1;
+if [ $ASSUME_YES != "yes" ]; then
+	read -p "Can we start now ? [y/N]" ANSWER
+	echo ""
+	if [ "$ANSWER" != "y" ]; then
+		echo Patching Kernel cancelled
+		exit 1;
+	fi
 fi
 
 # Here we go





More information about the linux-mtd-cvs mailing list