#!/bin/sh -e

if [ -z "$YESNO" ]; then
	YESNO=$"yYnN"
fi

cat <<EOF
I can automatically include various information about your cross building
configuration and debug output in your bug report. This information may help
to diagnose your problem.

EOF

if [ -f /tmp/dpkg-cross2.log ];then
yesno "May I include your dpkg-cross debug logs ? [Y/n] " yep
	if [ "$REPLY" = "yep" ]; then
		echo -e "\n-- dpkg-cross2.log --\n" >&3
		cat /tmp/dpkg-cross2.log >&3 2>&1
	else
		echo -e "\n-- (no dpkg-cross2 logfile present) --\n" >&3
	fi
	if [ -f /tmp/gccross2.log ]; then
		echo -e "\n-- gccross2.log --\n" >&3
		cat /tmp/gccross2.log >&3 2>&1
	else
		echo -e "\n-- (no gccross2 logfile present) --\n" >&3
	fi
fi

if [ -f "$HOME/.dpkg-cross/cross-compile" ]; then
	yesno "May I include $HOME/.dpkg-cross/cross-compile ? [Y/n] " yep
	if [ "$REPLY" = "yep" ]; then
		echo -e "\n-- $HOME/.dpkg-cross/cross-compile --\n" >&3
		cat $config >&3
	else
		echo -e "\n-- ( $HOME/.dpkg-cross/cross-compile present, but not submitted) --\n" >&3
	fi
fi

yesno "May I include /etc/dpkg-cross/cross-compile ? [Y/n] " yep
if [ "$REPLY" = "yep" ]; then
	echo -e "\n-- /etc/dpkg-cross/cross-compile --\n" >&3
	cat /etc/dpkg-cross/cross-compile >&3
else
	echo -e "\n-- (/etc/dpkg-cross/cross-compile not submitted) --\n" >&3
fi
