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)"
31 apply) bypass=false; break ;;
33 *) bypass=true; break ;;
39 echo >&3 "DGIT ABSURD GIT APPLY - BYPASS: $*"
45 case "$DGIT_ABSURD_DEBUG" in
65 fail "UNKNOWN OPTION $arg ($*)"
72 fail "BAD USAGE $arg ($noo $*)"
77 if [ $noo != 2 ]; then
82 patch=${patch#$pwd/debian/patches/}
83 rm -f debian/patches/series
85 # Work around #848611.
86 # We need a stunt filename which the source package must not
87 # contain. A trick is to use the commit hash of HEAD, whose
88 # hash value cannot appear in any file in its own tree.
89 omgwtf="dgit-omg-wtf-$(git rev-parse HEAD)"
90 cat <<END >debian/patches/$omgwtf
92 --- a/$omgwtf 2016-10-31 23:28:47.314155919 +0000
93 +++ b/$omgwtf 2016-12-18 22:40:01.870058270 +0000
97 printf "%s\n" "$omgwtf" >debian/patches/series
98 printf "%s\n" "$patch" >>debian/patches/series
100 # Just in case some joker tries to patch .git/something
103 dpkg-source --before-build .
110 rm -f $omgwtf debian/patches/$omgwtf
113 git checkout debian/patches/series
117 #printf 'APPLIED '; date --iso-8601=ns