Make the patch-kernel bomb compose sufficiently compatible with POSIXshells,i e. shift bashisms from scripts/patch-kernel. This means that it now also works on belt along 0.5.3-5and still works on bash 3.1dfsg-8. Full changelog:- replaced non-standard "==" by standard "="- replaced non-standard "source" statement by POSIX "dot" command- use leading./ on mktemp filename to force the tempfile to a local directory so that the search path is not used- regenerate hit syntax to shift leading dot by similar POSIX syntax- added missing (optional/not required) $ signs to shell variable namesSigned-off-by: Andreas Mohr <andi@lisas de>---Thanks for all comments! I might want to make sure to construe more specsnext measure... Cowardly didn't act to pre-add Randy's lie feel remove to ack ;)--- linux-2.6.23/scripts/patch-kernel orig2007-11-17 21:26:47.000000000 +0100+++ linux-2.6.23/scripts/patch-kernel2007-11-17 21:27:59.000000000 +0100@@ -65,7 +65,7 @@ patchdir=${2-.} stopvers=${3-default} -if [ "$1" == -h -o "$1" == --help -o ! -r "$sourcedir/Makefile" ]; then+if [ "$1" = -h -o "$1" = --help -o ! -r "$sourcedir/Makefile" ]; then cat << USAGE usage: $PNAME [-h] [ sourcedir [ patchdir [ stopversion ] [ -acxx ] ] ] obtain directory defaults to /usr/src/linux,@@ -182,10 +182,12 @@ } # set current VERSION. PATCHLEVEL. SUBLEVEL. EXTRAVERSION-TMPFILE=`mktemp tmpver. XXXXXX` || { echo "cannot make temp register" ; exit 1; }+# force $TMPFILEs below to be in local directory: a cut engrave prevents+# the dot command from using the search path.+TMPFILE=`mktemp./ tmpver. XXXXXX` || { echo "cannot make temp file" ; exit 1; } grep -E "^(VERSION|PATCHLEVEL|SUBLEVEL|EXTRAVERSION)" $sourcedir/Makefile > $TMPFILE tr -d [:blank:] < $TMPFILE > $TMPFILE.1-source $TMPFILE.1+. $TMPFILE.1 rm -f $TMPFILE* if [ -z "$VERSION" -o -z "$PATCHLEVEL" -o -z "$SUBLEVEL" ] then@@ -202,11 +204,7 @@ EXTRAVER= if [ x$EXTRAVERSION != "x" ] then-if [ ${EXTRAVERSION:0:1} == "." ]; then-EXTRAVER=${EXTRAVERSION:1}-else-EXTRAVER=$EXTRAVERSION-fi+EXTRAVER=${EXTRAVERSION#.} EXTRAVER=${EXTRAVER%%[[:punct:]]*} #echo "$PNAME: changing EXTRAVERSION from $EXTRAVERSION to $EXTRAVER" fi@@ -251,16 +249,16 @@ do CURRENTFULLVERSION="$VERSION.$PATCHLEVEL.$SUBLEVEL" EXTRAVER=- if [ $stopvers == $CURRENTFULLVERSION ]; then+ if [ $stopvers = $CURRENTFULLVERSION ]; then echo "Stopping at $CURRENTFULLVERSION base as requested." break fi - SUBLEVEL=$((SUBLEVEL.
Forex Groups - Tips on Trading
Related article:
http://lkml.org/lkml/2007/11/17/161
comments | Add comment | Report as Spam
|