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)"
33 author_vars='NAME EMAIL DATE'
34 for var in in $author_vars; do
35 eval "GIT_AUTHOR_$var=\$GIT_COMMITTER_$var"
39 try_commit () { git commit-tree "$try_commit_obj" </dev/null >/dev/null; }
41 maybe_squash_author () {
42 if (set -e; filter_path; try_commit); then return; fi
43 if ! (set -e; filter_path; squash_author; try_commit); then return; fi
44 read last <../../absurd-apply-applied
46 "dgit: warning: suppressed corrupted metadata! ($last)"
53 apply) bypass=false; break ;;
55 # Work around #950446 in gbp
56 echo >&3 "DGIT ABSURD GIT APPLY - COMMIT-TREE: $*"
62 *) bypass=true; break ;;
68 echo >&3 "DGIT ABSURD GIT APPLY - BYPASS: $*"
74 case "$DGIT_ABSURD_DEBUG" in
94 fail "UNKNOWN OPTION $arg ($*)"
101 fail "BAD USAGE $arg ($noo $*)"
106 if [ $noo != 2 ]; then
111 patch=${patch#$pwd/debian/patches/}
112 rm -f debian/patches/series
114 # Work around #848611.
115 # We need a stunt filename which the source package must not
116 # contain. A trick is to use the commit hash of HEAD, whose
117 # hash value cannot appear in any file in its own tree.
118 omgwtf="dgit-omg-wtf-$(git rev-parse HEAD)"
119 cat <<END >debian/patches/$omgwtf
121 --- a/$omgwtf 2016-10-31 23:28:47.314155919 +0000
122 +++ b/$omgwtf 2016-12-18 22:40:01.870058270 +0000
126 printf "%s\n" "$omgwtf" >debian/patches/series
127 printf "%s\n" "$patch" >>debian/patches/series
129 # Just in case some joker tries to patch .git/something
132 dpkg-source --before-build .
139 rm -f $omgwtf debian/patches/$omgwtf
142 git checkout debian/patches/series
146 printf >../../absurd-apply-applied '%s\n' "$patch"
147 #printf 'APPLIED '; date --iso-8601=ns