File: unapply_me

package info (click to toggle)
kernel-patch-2.0.36-m68k 2.0.36-3
  • links: PTS
  • area: main
  • in suites: slink
  • size: 1,168 kB
  • ctags: 6
  • sloc: sh: 254; makefile: 42
file content (34 lines) | stat: -rwxr-xr-x 897 bytes parent folder | download | duplicates (2)
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
#! /bin/sh

set -e

# Hardcoded because it helps cross compiling and there's no reason for it to be anything
# other than m68k
ARCHITECTURE=m68k
PATCHNAME=2.0.36-native.diff.gz
EXTRAPATCH=2.0.36-extra.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

PATCH_VERSION=$(patch -v | head -1 | sed -e 's/[^0-9\.]//g')

if dpkg --compare-versions $PATCH_VERSION \>= 2.2 
then
    PATCH_OPTIONS="-l -s -z .native-orig -p1" 
else
    PATCH_OPTIONS="-l -s -b .native-orig -p1"
fi

if [ -f $PATCHDIR/$EXTRAPATCH ] ; then
  zcat $PATCHDIR/$EXTRAPATCH | patch -R $PATCH_OPTIONS 
fi
zcat $PATCHDIR/$PATCHNAME | 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
exit 0