#!/bin/bash TEMPDIR=$( mktemp -d ) ORIGPWD=$( pwd ) cp /mnt/scratch/mcermak/testlogs/systemtap.upstream/*tar.xz $TEMPDIR/ pushd $TEMPDIR || exit 1 # rename files so that identical commit hashes get identical (lowest possible) timestamp for sorting purposes HASHES=$(ls systemtap*mcermak*tar.xz | awk -F\. '{print $4}' | sort -u) for h in $HASHES; do echo Processing hash $h MINSTAMP4HASH=$( ls *$h* | tr '-' '.' | awk -F\. '{print $9}' | sort -n | grep '[0-9]\+' | head -n 1 ) echo Min stamp for hash is: $MINSTAMP4HASH PKG4HASH=$( ls *$h* ) for p in $PKG4HASH; do echo Processing pkg $p PKGSTAMP=$( echo $p | tr '-' '.' | awk -F\. '{print $9}' ) rename 'systemtap' "$MINSTAMP4HASH" $p done done # extract systemtap.sum files and rename them for f in $( ls *tar.xz ); do tar xJf $f systemtap.sum mv systemtap.sum $f.sum rename 'tar.xz.sum' 'log' $f.sum done sh $ORIGPWD/report-helper.sh | tee wiki.out sed -i 's/UNKNOWN/?/g' wiki.out sed -i 's/UNTESTED/-/g' wiki.out sed -i 's/PASS/P/g' wiki.out sed -i 's/FAIL/F/g' wiki.out sed -i 's/ERROR/E/g' wiki.out echo uploading logs to scratch... OUT=/mnt/scratch/mcermak/testlogs/out rm -rf $OUT && mkdir -p $OUT && chmod a+rwx $OUT && cp -v *tar.xz $OUT/ echo uploading to wiki... cat wiki.out | $ORIGPWD/wikiup 'mcermak/systemtap.upstream' popd # $TEMPDIR rm -rf $TEMPDIR