Update to patch-kernel to deal with 2.2.0-preX

Nick Holloway (Nick.Holloway@alfie.demon.co.uk)
30 Dec 1998 11:33:45 -0000


I've got used to being able to use patch-kernel to easily get a clean
tree by unpacking the latest full tree I have (currently 2.1.112), and
using "patch-kernel" to bring it up to date. With the introduction of
2.2.0-preX, this no longer works.

So, given the choice of applying the patches by hand, or making a minor
modification to patch-kernel, I chose the latter. Following this message
is a patch to "patch-kernel" to make it understand 2.2.0-preX series.

This patch is _not_ intended to be applied by Linus to the kernel source,
this is to be applied locally for those that wish to continue using
patch-kernel until 2.2.0 comes along.

--- patch-kernel-dist Wed Dec 30 10:59:26 1998
+++ patch-kernel Wed Dec 30 11:20:37 1998
@@ -21,7 +21,8 @@
sourcedir=${1-/usr/src/linux}
patchdir=${2-.}

-# set current VERSION, PATCHLEVEL, SUBLEVEL
+# set current VERSION, PATCHLEVEL, SUBLEVEL and EXTRAVERSION (if applicable)
+EXTRAVERSION=
eval `sed -n 's/^\([A-Z]*\) = \([0-9]*\)$/\1=\2/p' $sourcedir/Makefile`
if [ -z "$VERSION" -o -z "$PATCHLEVEL" -o -z "$SUBLEVEL" ]
then
@@ -29,12 +30,24 @@
exit 1
fi

-echo "Current kernel version is $VERSION.$PATCHLEVEL.$SUBLEVEL"
+echo "Current kernel version is $VERSION.$PATCHLEVEL.$SUBLEVEL$EXTRAVERSION"

while :
do
- SUBLEVEL=`expr $SUBLEVEL + 1`
- patch=patch-$VERSION.$PATCHLEVEL.$SUBLEVEL
+ # Handle switch from 2.1.* to 2.2.0-pre*
+ if [ "$VERSION.$PATCHLEVEL.$SUBLEVEL" = "2.1.132" ]
+ then
+ VERSION=2 PATCHLEVEL=2 SUBLEVEL=0 EXTRAVERSION=-pre0
+ fi
+
+ if [ -z "$EXTRAVERSION" ]
+ then
+ SUBLEVEL=`expr $SUBLEVEL + 1`
+ else
+ EXTRAVERSION=-pre`expr $EXTRAVERSION : '-pre\([0-9]*\)' + 1`
+ fi
+
+ patch=patch-$VERSION.$PATCHLEVEL.$SUBLEVEL$EXTRAVERSION
if [ -r $patchdir/${patch}.gz ]; then
ext=".gz"
name="gzip"

-- 
 `O O'  | Home: Nick.Holloway@alfie.demon.co.uk  http://www.alfie.demon.co.uk/
// ^ \\ | Work: Nick.Holloway@parallax.co.uk

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/