1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
#! /bin/sh
#
# (C) 1998 Manoj Srivastava & Eric Delaunay.
set -e
ARCHITECTURE=`dpkg --print-installation-architecture`
PATCHNAME=netwinder
PATCHFILE=patch-cvs-19991215-debian-2.2.13.diff.gz
PATCHDIR=/usr/src/kernel-patches/$ARCHITECTURE
if ! test -d kernel -a -d Documentation ; then
echo "Not in kernel top level directory. Exiting" >&2
exit 1
fi
if ! test -f debian/APPLIED_${ARCHITECTURE}_$PATCHNAME ; then
exit 0 # no need to remove a non existent patch
fi
VERSION=$(grep ^VERSION Makefile 2>/dev/null | \
sed -e 's/[^0-9]*\([0-9]*\)/\1/')
PATCHLEVEL=$(grep ^PATCHLEVEL Makefile 2>/dev/null | \
sed -e 's/[^0-9]*\([0-9]*\)/\1/')
SUBLEVEL=$(grep ^SUBLEVEL Makefile 2>/dev/null | \
sed -e 's/[^0-9]*\([0-9]*\)/\1/')
PATCH_VERSION=$(patch -v | head -1 | sed -e 's/[^0-9\.]//g')
PATCH_OPTIONS="-l -s -p1"
zcat $PATCHDIR/$PATCHFILE | patch -R $PATCH_OPTIONS
echo "Removing empty files after unpatching" >&2
find . -type f -size 0 -exec rm {} \; -print
rm -f debian/APPLIED_${ARCHITECTURE}_$PATCHNAME
[ -d debian ] && rmdir -p debian
exit 0
|