summarise_log.sh #1

  • //
  • guest/
  • alan_petersen/
  • p4transfer/
  • summarise_log.sh
  • View
  • Commits
  • Open Download .zip Download (734 B)
#!/bin/bash
# Produce a summary log file for reporting problems with P4Transfer.
# Please run this script on your log file and send the results to consulting@perforce.com or your
# direct Perforce contact.
#
# It extracts the header information and the details of the failing changelist at the end of the log
# file.
#
# Usage:
#   sum_log.sh log-P4Transfer-20141208094716.log > sum.log

log_file=$1

head_count=`head -200 $log_file | grep -n "src('changes'" | head -1 | cut -d: -f1`

last_change_line_no=`grep -n "Processing change:" $log_file | tail -1 | cut -d: -f1`
lines=`wc -l $log_file | sed -E 's/^ *//' | cut -d" " -f1`
tail_count=$(( $lines - $last_change_line_no ))

head -$head_count $log_file
tail -$tail_count $log_file
# Change User Description Committed
#1 15072 alan_petersen Merging

//guest/perforce_software/p4transfer/...

to //guest/alan_petersen/p4transfer/...
//guest/perforce_software/p4transfer/summarise_log.sh
#3 12496 Robert Cowham Fix summarise for larger files.
#2 12358 Robert Cowham Put in a pointer to form_mail just in case useful.
Possibly fix summarise shell.
#1 11431 Robert Cowham Add utility script for reporting errors, and also a description of how to report errors (what to email).