4 case "$DGIT_ABSURD_DEBUG" in
5 ''|0) exec 3>/dev/null ;;
6 1) exec 3>>../../gbp-pq-output ;;
7 *) exec 3>>../../gbp-pq-output 2>&3 ;;
10 exec 4>>../../absurd-apply-warnings
13 echo >&3 "DGIT ABSURD GIT APPLY (DEBUG) $*"
14 echo >&2 "DGIT ABSURD GIT APPLY (STDERR) $*"
24 if test "x$PATH" = "x$npath"; then
25 fail "PATH FILTER FAIL ($0 $self $PATH)"
35 apply) bypass=false; break ;;
37 *) bypass=true; break ;;
43 echo >&3 "DGIT ABSURD GIT APPLY - BYPASS: $*"
49 case "$DGIT_ABSURD_DEBUG" in
69 fail "UNKNOWN OPTION $arg ($*)"
76 fail "BAD USAGE $arg ($noo $*)"
81 if [ $noo != 2 ]; then
86 patch=${patch#$pwd/debian/patches/}
87 rm -f debian/patches/series
89 # Work around #848611.
90 # We need a stunt filename which the source package must not
91 # contain. A trick is to use the commit hash of HEAD, whose
92 # hash value cannot appear in any file in its own tree.
93 omgwtf="dgit-omg-wtf-$(git rev-parse HEAD)"
94 cat <<END >debian/patches/$omgwtf
96 --- a/$omgwtf 2016-10-31 23:28:47.314155919 +0000
97 +++ b/$omgwtf 2016-12-18 22:40:01.870058270 +0000
101 printf "%s\n" "$omgwtf" >debian/patches/series
102 printf "%s\n" "$patch" >>debian/patches/series
104 # Just in case some joker tries to patch .git/something
107 dpkg-source --before-build .
114 rm -f $omgwtf debian/patches/$omgwtf
117 git checkout debian/patches/series
121 #printf 'APPLIED '; date --iso-8601=ns