From 64459f3c785e9d9db4664fee3419f4ee41b47cd2 Mon Sep 17 00:00:00 2001 From: cagney Date: Thu, 23 Sep 2004 13:24:49 +0000 Subject: [PATCH] Useful shell scripts. --- gdb2fail.sh | 27 +++++++++++++++++++++++++++ gdb2patch.sh | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100755 gdb2fail.sh create mode 100755 gdb2patch.sh diff --git a/gdb2fail.sh b/gdb2fail.sh new file mode 100755 index 0000000..d2743b4 --- /dev/null +++ b/gdb2fail.sh @@ -0,0 +1,27 @@ +#!/bin/sh + +if test "$#" -eq 0 +then + echo usage: $0 beehive log files + exit 1 +fi + +sum= +for f in "$@" +do + echo $f + pid=`basename $f | sed -e 's/^[^0-9]*-\([0-9]*\)-\([^-]*\)-.*$/\1/'` + isa=`basename $f | sed -e 's/^[^0-9]*-\([0-9]*\)-\([^-]*\)-.*$/\2/'` + # begin 644 gdb-i386-redhat-linux-gnu.tar.bz2 + if grep '^begin [0-9]* ' $f && grep '^end$' $f + then + for t in sum log + do + uudecode -o /dev/stdout $f | bunzip2 \ + | tar xpvOf - gdb-${isa}-redhat-linux-gnu.$t \ + > gdb-${pid}-${isa}.$t + done + fi +done + +/home/cygnus/cagney/bin/do-analize-tests gdb-${pid}-*.sum diff --git a/gdb2patch.sh b/gdb2patch.sh new file mode 100755 index 0000000..517f9d3 --- /dev/null +++ b/gdb2patch.sh @@ -0,0 +1,40 @@ +#!/bin/sh + +# Generate a patch that brings the most recent snapshot up-to-date + +#branch=HEAD +date='-D 2004-06-07-gmt' +dir=`echo "cvs${branch}${date}" | tr ' ' '-'` +patch=gdb-`sed -n -e 's/^Version:[ ]*\(.*\)$/\1/p' gdb.spec` + +if test ! -d ${dir}/src +then + ( mkdir -p ${dir} && cd ${dir} && cvs \ + -d :pserver:anoncvs@sources.redhat.com:/cvs/src \ + checkout ${branch} ${date} gdb ) +fi + +( cd ${dir}/src && cvs diff -Nu -r BASE -D `date -u +"%Y-%m-%d-gmt"` ./gdb ) | sed -e ' +/^Index: .*\/version\.in$/,/^Index/ d +/^Index:/d +/^====/d +/^RCS/d +/^retrieving/d +/^diff/d +/^--- /N +/^---.* \/dev\/null/ { + p + d +} +/^--- / { + s/^--- \([-a-zA-Z\/\.0-9\+]*\)/--- \1.1/ + p + d +} +' | tee $patch-sync-`date -u +%Y%m%d` + +exit + +# s/^--- \([-a-zA-Z\/\.0-9\+]*\)/--- \1.1/ +# s/^[\+][\+][\+] \([-a-zA-Z\/\.0-9\+]*\)/+++ \1/ +