#!/bin/bash -e

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

cat <<EOF


I can automatically include information about your EVMS configuration
in your bug report.  This information will help to diagnose your
problem.

EOF

if [ -f /var/log/evms-engine.log ]; then
  cat <<EOF


When the EVMS engine runs (whether the GUI, ncurses, CLI, etc.), it records a
log file for the session.  If you are experiencing a problem within the engine,
you should include this log file in your report.

I can automatically include your most recent log file.  If the problem did not
occur the last time you ran the engine, you should run it now so that I can
include a log file which demonstrates the problem.

EOF

  yesno "May I include your most recent EVMS engine log in the bug report? " yep
  if [ "$REPLY" = "yep" ]; then
    echo "engine log:" >&3
    echo "-----------" >&3
    cat /var/log/evms-engine.log >&3
    echo
  fi
fi

yesno "May I include your EVMS configuration data in the bug report? " yep

if [ "$REPLY" = "yep" ]; then
  evms_gather_info >&3
  echo >&3
fi
