#!/bin/sh dry_run="" [ "$1" = "--dry-run" ] && dry_run="1" if [ ! -f "index.html" -o ! -f "errors.html" ] then echo "chdir to the data directory" >&2 exit 1 fi find . -name report | while read r do r=$(dirname "$r") # strip the trailing /report dir=$(dirname "$r") src=$(basename "$r") case "$src" in win8_newtb-*|win8_cw-*) # Renaming the Windows 8.1 reports does not change the group they # appear in but gets them to be labeled as the correct 'win81' # rather than 'win8' (we don't currently have any Windows 8.0 test # configuration). dst=$(echo "$src" | sed -e 's/^win8_/win81_/') ;; win10_newtb-*v1507*|win10_*-1507-*) dst=$(echo "$src" | sed -e 's/^win10_/win1507_/') ;; win10_newtb-*v1607*|win10_*-1607-*) dst=$(echo "$src" | sed -e 's/^win10_/win1607_/') ;; win10_newtb-*v1709*|win10_*-1709-*) dst=$(echo "$src" | sed -e 's/^win10_/win1709_/') ;; win10_newtb-*v1809*|win10_*-1809-*) dst=$(echo "$src" | sed -e 's/^win10_/win1809_/') ;; win10_newtb-*v1909*|win10_*-1909-*) dst=$(echo "$src" | sed -e 's/^win10_/win1909_/') ;; win10_newtb-w10pro64*) dst=$(echo "$src" | sed -e 's/^win10_/win2004_/') ;; win10_newtb-w1064*|win10_fgtb-w10pro64*) dst=$(echo "$src" | sed -e 's/^win10_/win2009_/') ;; *) dst="" ;; esac if [ -n "$dst" ] then echo "mv $r $dir/$dst" [ -z "$dry_run" ] && mv "$r" "$dir/$dst" fi done