#! /bin/tcsh -f

#
# bugr
#
# Generates the info needed to adequately address
# a Freesurfer bug report or question.
#
# Original Author: Nick Schmansky
# CVS Revision Info:
#    $Author: greve $
#    $Date: 2009/03/13 19:34:15 $
#    $Revision: 1.3 $
#
# Copyright (C) 2002-2007,
# The General Hospital Corporation (Boston, MA).
# All rights reserved.
#
# Distribution, usage and copying of this software is covered under the
# terms found in the License Agreement file named 'COPYING' found in the
# FreeSurfer source code root directory, and duplicated here:
# https://surfer.nmr.mgh.harvard.edu/fswiki/FreeSurferOpenSourceLicense
#
# General inquiries: freesurfer@nmr.mgh.harvard.edu
# Bug reports: analysis-bugs@nmr.mgh.harvard.edu
#

set VERSION = '$Id: bugr,v 1.3 2009/03/13 19:34:15 greve Exp $';

echo ""
echo "Cut-and-paste the following info into your FreeSurfer problem report:"
echo "---------------------------------------------------------------------"
echo ""

echo "FREESURFER_HOME: $FREESURFER_HOME"
echo ""

if ( -e $FREESURFER_HOME/build-stamp.txt) then

  echo "Build stamp: `cat $FREESURFER_HOME/build-stamp.txt`"
  echo ""

else

  echo "'build-stamp.txt file does not exist!"
  echo "This appears to be a very old version of FreeSurfer!"
  echo ""

endif

if ( -e /etc/redhat-release) then

  echo "RedHat release: `cat /etc/redhat-release`"
  echo ""

endif

if ( -e /etc/debian_version) then

  echo "Debian version: `cat /etc/debian_version`"
  echo ""

endif

echo "Kernel info: `uname -rms`"
echo ""

if ( -e /space/freesurfer) then

  echo "NMR Center info (/space/freesurfer exists):"
  echo ""

  echo "  machine: `uname -n`"
  echo ""

  echo "  SUBJECTS_DIR: $SUBJECTS_DIR"
  echo ""

  echo "  PWD: $PWD"
  echo ""
  echo "  ssh `uname -n`"
  echo "  setenv SUBJECTS_DIR $SUBJECTS_DIR"
  echo "  cd $PWD"

endif

echo "---------------------------------------------------------------------"
echo "Please include the following additional information in your report:"
echo ""

echo "  1) subject name"
echo "  2) the entire command-line executed"
echo "  3) the error message generated"
echo "  4) optionally include the subject's /script/recon-all.log"
echo ""
echo "See also: http://surfer.nmr.mgh.harvard.edu/fswiki/BugReporting"
echo ""
