File: nattpatch

package info (click to toggle)
openswan 1%3A2.4.6%2Bdfsg.2-1.1%2Betch2
  • links: PTS
  • area: main
  • in suites: etch
  • size: 25,000 kB
  • ctags: 16,877
  • sloc: ansic: 121,112; sh: 19,782; xml: 9,699; asm: 4,422; perl: 4,087; makefile: 3,367; tcl: 713; exp: 657; yacc: 396; pascal: 328; lex: 289; sed: 265; awk: 124; lisp: 3
file content (63 lines) | stat: -rwxr-xr-x 1,585 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/sh

# wander through an OpenSWAN nat-t directory, creating a patch file (to stdout)
# that will apply the code to a kernel source directory.
#
# $Id: nattpatch,v 1.2 2005/04/06 17:47:44 mcr Exp $
#

KERN=$1
shift

source packaging/utils/kernelpatching.sh

patch20=false
patch22=false
patch24=false
patch26=false

case $KERN in
    2.0) patchname=os2_0; altname=fs2_0; patch20=true;;
    2.2) patchname=os2_2; altname=fs2_2; patch22=true;;
    2.4) patchname=os2_4; altname=fs2_4; patch24=true;;
    2.6) patchname=os2_6; altname=fs2_6; patch26=true;;
    *) echo "Invalid kernel patch target: $KERN"; exit 1;;
esac

# make sure that sort gets the right locale.
LANG=C export LANG
LC_ALL=C export LC_ALL


find nat-t -type f -print | grep -v CVS | egrep -v 'linux/Makefile' | sort | while read file 
do 
  base=`basename $file`
  pname=`echo $file | sed -e 's,\.fs._.$,,' -e 's,\.os._.$,,'`

  case $base in 
    TAGS) ;;
    tags) ;;
    .cvsignore) ;;
    .*.o.flags) ;;
    .\#*);;
    *.o) ;;
    *~) ;;
    tagsfile.mak) ;;
    *.$patchname.patch) cat $file;;
    *.$altname.patch) cat $file;;
    *.fs2_0) fakeallpatch $patch20 $file $pname ;;
    *.fs2_2) fakeallpatch $patch22 $file $pname ;;
    *.fs2_4) fakeallpatch $patch24 $file $pname ;;
    *.fs2_6) fakeallpatch $patch26 $file $pname ;;
    *.os2_0) fakeallpatch $patch20 $file $pname ;;
    *.os2_2) fakeallpatch $patch22 $file $pname ;;
    *.os2_4) fakeallpatch $patch24 $file $pname ;;
    *.os2_6) fakeallpatch $patch26 $file $pname ;;
    *.patch) ;;
    *) diff -u /dev/null $file;;
  esac
done

exit 0