Commit 521f3be3 authored by Archit Tamarapu's avatar Archit Tamarapu
Browse files

[fix] update linux script to produce same output

parent 2e133313
Loading
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -28,12 +28,12 @@

param(
    [Parameter(Mandatory)]
    [String]$in_dir,
    [String]$proc_output_dir,
    [Parameter(Mandatory)]
    [String]$out_file
)

(Get-ChildItem $in_dir -Recurse | Where-Object { $_.Name -like '*c??.wav' }) | 
(Get-ChildItem $proc_output_dir -Recurse | Where-Object { $_.Name -like '*c??.wav' }) | 
ForEach-Object { 
    $name = $_.Name
    $hash = (Get-FileHash $_.FullName -Algorithm MD5).Hash
+8 −13
Original line number Diff line number Diff line
@@ -31,26 +31,21 @@
# simple script to create MD5 files as if produced by Microsoft Powershell
# run from within proc_output_x folder

if [ $# -lt 1 ]; then
    echo "Usage: $0 testname.md5"
if [ $# -lt 2 ]; then
    echo "Usage: $0 proc_output_dir testname.md5"
    echo "Requires: md5sum"
    exit 1
fi

system=$(uname -s)

echo "" >$1
echo "AlgorithmHashPath" >>$1
echo "-----------------" >>$1

if [ "$system" = "Darwin" ]; then
    md5 -r [cFH][aO][tA]*/c??/*.wav | awk '{print "MD5"toupper($1)".\\"$2 }' | tr -s '/' '\\' >>$1
    md5="md5 -r"
else
    md5sum [cFH][aO][tA]*/c??/*.wav | awk '{print "MD5"toupper($1)".\\"$2 }' | tr -s '/' '\\' >>$1
    md5=md5sum
fi

echo "" >>$1
echo "" >>$1
echo "" >>$1

unix2dos $1
echo "" > $2
for f in $(find $1 -name "*c??.wav"); do
    echo ${f##*/} $($md5 $f | awk '{ print toupper($1) }') >>$2
done