]> piware.de Git - bin.git/blob - dsrc-new-patch
initial checkin
[bin.git] / dsrc-new-patch
1 #!/bin/sh -e
2
3 [ -n "$1" ]
4 [ -e debian/rules ]
5 [ -d debian/patches ]
6 [ ! -e debian/patches/$1 ]
7
8 CWD=`pwd`
9 D=`mktemp -d`
10 trap "rm -rf $D" 0 1 2 3 4 5 6 7 8 10 11 12 13 14 15
11
12 debclean
13 cp -r . $D/orig
14 cd $D/orig
15 debian/rules setup || debian/rules patch || debian/rules apply-patches || debian/rules apply-dpatches || debian/rules unpack || debian/rules patch-stamp
16 [ -z "`find -name '*.rej'`" ] || {
17     echo 'there are rejections from the current patches, aborting' >&2
18     exit 1
19 }
20 find -name '*.orig' | xargs rm || true
21 cd ..
22 cp -a orig new
23 cd new
24 echo 'make your modifications in this shell and exit it successfully'
25 bash
26 find -name '*.orig' | xargs rm || true
27 cd ..
28 diff -Nurp orig new > "$CWD/debian/patches/$1"