OSDN Git Service

2013.10.24
[uclinux-h8/uClinux-dist.git] / freeswan / klips / patches / kernel.patch.gen.sh
1 #!/bin/bash
2 #
3 # RCSID $Id: kernel.patch.gen.sh,v 1.4 1999/04/06 04:54:30 rgb Exp $
4
5 patchdir=`pwd`
6 kernelsrc=/usr/src/linux
7 [ "$1~" = "~" ] || kernelsrc=$1
8 cd $kernelsrc
9 # clean out destination file for all patch
10 #echo "">$patchdir/all
11
12 # find files to patch and loop
13 for i in  `find . -name '*.preipsec'`
14 do
15
16 # strip off '.preipsec' suffix
17 j=${i%.preipsec}
18
19 # strip off './' prefix
20 k=${j#\.\/}
21
22 # single unified diff
23 #diff -u $i $j >>$patchdir/all
24
25 # convert '/' in filename to '.' to avoid subdirectories
26 sed -e 's/\//\./g' << EOI > /tmp/t
27 $k
28 EOI
29 l=`cat /tmp/t`
30 rm -f /tmp/t
31
32 # *with* path from source root
33 #echo do diff -u $i $j '>' $patchdir/$l
34 echo found $i
35 echo "RCSID \$Id: kernel.patch.gen.sh,v 1.4 1999/04/06 04:54:30 rgb Exp $" >$patchdir/$l
36 diff -u $i $j >>$patchdir/$l
37
38 done
39
40 #
41 # $Log: kernel.patch.gen.sh,v $
42 # Revision 1.4  1999/04/06 04:54:30  rgb
43 # Fix/Add RCSID Id: and Log: bits to make PHMDs happy.  This includes
44 # patch shell fixes.
45 #
46 #