/usr/share/doc/quilt/examples/dpatch2quilt.sh is in quilt 0.63-8.2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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
# to be run from the package top level directory
# parts taken from http://blog.orebokech.com/2007/08/converting-debian-packages-from-dpatch.html
# (c) gregor herrmann, 2007-2008, GPL2+
# (c) Damyan Ivanov, 2007-2008, GPL2+
# (c) Martin Quinson, 2008, GPL2+
# svn-related lines commented out by Martin Quinson.
set -e
export QUILT_PATCHES=debian/patches
dh_testdir
[ -f debian/patches/00list ] || exit 1
for p in $(dpatch list-all); do
quilt import -P $p.patch debian/patches/$p.dpatch
AUTHOR=$(dpatch cat --author-only $p.dpatch)
DESC=$(dpatch cat --desc-only $p.dpatch)
echo "Author: $AUTHOR" | quilt header -r $p.patch
echo "Description: $DESC" | quilt header -a $p.patch
quilt push
quilt refresh --no-timestamps --no-index --strip-trailing-whitespace
# svn add debian/patches/$p.patch
done
quilt pop -a
COUNT_D=$(ls -1 debian/patches/*.dpatch | wc -l)
COUNT_Q=$(ls -1 debian/patches/*.patch | wc -l)
# svn add debian/patches/series
# svn rm debian/patches/00list debian/patches/*.dpatch
sed -i -e 's;/usr/share/dpatch/dpatch\.make;/usr/share/quilt/quilt.make;' debian/rules
sed -i -e 's;DPATCH_STAMPFN;QUILT_STAMPFN;' debian/rules
sed -i -e 's;patch-stamp;$(QUILT_STAMPFN);' debian/rules
# same as "sed s/dpatch/quilt", but supports multi-line Build-Depends
perl -i -pe '
if( /^Build-Depends: / ) {
$do_replace = 1;
s/dpatch ?(?:\(.+\))?/quilt (>= 0.40)/;
next;
}
if( /^ / ) {
s/dpatch ?(?:\(.+\))?/quilt (>= 0.40)/ if $do_replace;
} else {
$do_replace = 0;
}' debian/control
echo
echo "The next commit would remove $COUNT_D dpatch patches and add $COUNT_Q quilt patches."
if [ "$COUNT_D" != "$COUNT_Q" ] ; then
echo "WARNING: The numbers of removed dpatch patches and added quilt patches differ!"
fi
exit 0
|