lkml.org 
[lkml]   [1998]   [Jan]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: bzip2 patches
On Fri, 16 Jan 1998, Bernd Paysan wrote:

->Since ftp.kernel.org now has bzip2ed kernel patches, which save space and
->download time, I felt obliged to to modify the script patch-kernel
->appropriate. It looks now for a gziped patch, and if not found tries a
->bzip2ed patch.

I did something similar a while ago, and sent it to Linus twice, but it
neither got into kernel, nor I got any response why it got rejected.
This or other way, it is here once again :)

================================================
new in this patch:
-support for uncompress.
-it has actually comment field what it does
================================================
--- linux/scripts/patch-kernel.old Tue Mar 26 14:22:14 1996
+++ linux/scripts/patch-kernel Sat Jan 17 16:02:27 1998
@@ -11,6 +11,11 @@
# successful. If it is, then all of the "*.orig" files are removed.
#
# Nick Holloway <Nick.Holloway@alfie.demon.co.uk>, 2nd January 1995.
+#
+# Added support for handling multiple types of compression. What includes
+# gzip, bzip, bzip2, zip, compress, and plaintext.
+#
+# Adam Sulmicki <adam@cfar.umd.edu>, 1st January 1997.

# Set directories from arguments, or use defaults.
sourcedir=${1-/usr/src/linux}
@@ -29,16 +34,39 @@
while :
do
SUBLEVEL=`expr $SUBLEVEL + 1`
- patch=patch-$VERSION.$PATCHLEVEL.$SUBLEVEL.gz
- if [ ! -r $patchdir/$patch ]
- then
- break
+ patch=patch-$VERSION.$PATCHLEVEL.$SUBLEVEL
+ if [ -r $patchdir/${patch}.gz ]; then
+ ext=".gz"
+ name="gzip"
+ uncomp="gunzip -dc"
+ elif [ -r $patchdir/${patch}.bz ]; then
+ ext=".bz"
+ name="bzip"
+ uncomp="bunzip -dc"
+ elif [ -r $patchdir/${patch}.bz2 ]; then
+ ext=".bz2"
+ name="bzip2"
+ uncomp="bunzip2 -dc"
+ elif [ -r $patchdir/${patch}.zip ]; then
+ ext=".zip"
+ name="zip"
+ uncomp="unzip -d"
+ elif [ -r $patchdir/${patch}.Z ]; then
+ ext=".Z"
+ name="uncompress"
+ uncomp="uncompress -c"
+ elif [ -r $patchdir/${patch} ]; then
+ ext=""
+ name="plaintext"
+ uncomp="cat"
+ else
+ break
fi

- echo -n "Applying $patch... "
- if gunzip -dc $patchdir/$patch | patch -p1 -s -N -E -d $sourcedir
+ echo -n "Applying ${patch} (${name})... "
+ if $uncomp ${patchdir}/${patch}${ext} | patch -p1 -s -N -E -d $sourcedir
then
- echo "done."
+ echo "done."
else
echo "failed. Clean up yourself."
break
================================================
-Adam


\
 
 \ /
  Last update: 2005-03-22 13:41    [W:0.029 / U:0.288 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site