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 ;;
11 echo >&3 "DGIT ABSURD GIT APPLY (DEBUG) $*"
12 echo >&2 "DGIT ABSURD GIT APPLY (STDERR) $*"
22 if test "x$PATH" = "x$npath"; then
23 fail "PATH FILTER FAIL ($0 $self $PATH)"
29 apply) bypass=false; break ;;
31 *) bypass=true; break ;;
37 echo >&3 "DGIT ABSURD GIT APPLY - BYPASS: $*"
43 case "$DGIT_ABSURD_DEBUG" in
63 fail "UNKNOWN OPTION $arg ($*)"
70 fail "BAD USAGE $arg ($noo $*)"
75 if [ $noo != 2 ]; then
80 patch=${patch#$pwd/debian/patches/}
81 rm -f debian/patches/series
83 # Work around #848611.
84 # We need a stunt filename which the source package must not
85 # contain. A trick is to use the commit hash of HEAD, whose
86 # hash value cannot appear in any file in its own tree.
87 omgwtf="dgit-omg-wtf-$(git rev-parse HEAD)"
88 cat <<END >debian/patches/$omgwtf
90 --- a/$omgwtf 2016-10-31 23:28:47.314155919 +0000
91 +++ b/$omgwtf 2016-12-18 22:40:01.870058270 +0000
95 printf "%s\n" "$omgwtf" >debian/patches/series
96 printf "%s\n" "$patch" >>debian/patches/series
98 # Just in case some joker tries to patch .git/something
101 dpkg-source --before-build .
108 rm -f $omgwtf debian/patches/$omgwtf
111 git checkout debian/patches/series
115 #printf 'APPLIED '; date --iso-8601=ns