Shortly after sending, I discovered that it wouldn't extract EXTRAVERSION
from the Makefile, and so will be unable to upgrade from 2.2.0-preX.
Here is a fixed version.
--- linux-2.1/scripts/patch-kernel-dist Wed Dec 30 10:59:26 1998
+++ linux-2.1/scripts/patch-kernel Wed Dec 30 13:32:27 1998
@@ -21,20 +21,33 @@
sourcedir=${1-/usr/src/linux}
patchdir=${2-.}
-# set current VERSION, PATCHLEVEL, SUBLEVEL
-eval `sed -n 's/^\([A-Z]*\) = \([0-9]*\)$/\1=\2/p' $sourcedir/Makefile`
+# set current VERSION, PATCHLEVEL, SUBLEVEL and EXTRAVERSION (if applicable)
+EXTRAVERSION=
+eval `sed -n 's/^\([A-Z]*\) = *\([0-9a-z-]*\)$/\1=\2/p' $sourcedir/Makefile`
if [ -z "$VERSION" -o -z "$PATCHLEVEL" -o -z "$SUBLEVEL" ]
then
echo "unable to determine current kernel version" >&2
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/