*.deb extraction utility (also *.dsc by wrapping “dpkg-source -x”)
[shellsnippets/shellsnippets.git] / mksh / debian-dev / dot.quiltrc
1 # $MirOS: contrib/hosted/tg/deb/dot.quiltrc,v 1.5 2013/12/31 10:17:32 tg Exp $
2 #-
3 # Configuration options (set to non-empty value to enable):
4 # * QUILTRC_ENABLE: generate patches in a standardised format
5 #   (enabled by default if QUILT_PATCHES was empty or “-” and
6 #   we find ourselves to be in a Debian 3.0 (quilt) package)
7 # * QUILTRC_NO_DIFF_P: do not show C function context in diffs
8 #
9 # If QUILT_PATCHES is empty or a sole hyphen-minus, this ~/.quiltrc
10 # checks for Debian 3.0 (quilt) source package and sets QUILT_PATCHES
11 # to "debian/patches" if found; otherwise, if it was a hyphen-minus,
12 # to "patches".
13
14 while test -z "$QUILT_PATCHES" || test x"$QUILT_PATCHES" = x"-"; do
15         d=.
16         while :; do
17                 test -d $d/debian && test -x $d/debian/rules && break
18                 test x"$(/bin/readlink -e $d)" = x"/" && break
19                 d=$d/..
20         done
21         test -x $d/debian/rules || break
22
23         # now in Debian packaging tree with unset $QUILT_PATCHES
24
25         QUILT_PATCHES="debian/patches"
26         test -d $d/debian/patches || mkdir $d/debian/patches
27         QUILTRC_ENABLE=1
28
29         # this is not a real loop, exit it always
30         break
31 done
32 if test -n "$QUILTRC_ENABLE"; then
33         # enable options to generate standardised patches
34         QUILT_PATCH_OPTS="--reject-format=unified"
35         QUILT_DIFF_OPTS=""
36         test -n "$QUILTRC_NO_DIFF_P" || \
37             QUILT_DIFF_OPTS="$QUILT_DIFF_OPTS --show-c-function"
38         QUILT_DIFF_ARGS="-p ab --no-timestamps --no-index --color=auto"
39         QUILT_REFRESH_ARGS="-p ab --no-timestamps --no-index --sort"
40         QUILT_PUSH_ARGS="--color=auto"
41         QUILT_COLORS="diff_hdr=1;32:diff_add=1;34:diff_rem=1;31:diff_hunk=1;33:diff_ctx=35:diff_cctx=33"
42 fi
43 test x"$QUILT_PATCHES" = x"-" && QUILT_PATCHES=patches
44 :