michael@0: #!/bin/bash michael@0: # Compares two mars michael@0: michael@0: marA="$1" michael@0: marB="$2" michael@0: testDir="$3" michael@0: workdir="/tmp/diffmar/$testDir" michael@0: fromdir="$workdir/0" michael@0: todir="$workdir/1" michael@0: michael@0: # On Windows, creation time can be off by a second or more between the files in michael@0: # the fromdir and todir due to them being extracted synchronously so use michael@0: # time-style and exclude seconds from the creation time. michael@0: lsargs="-algR" michael@0: unamestr=`uname` michael@0: if [ ! "$unamestr" = 'Darwin' ]; then michael@0: unamestr=`uname -o` michael@0: if [ "$unamestr" = 'Msys' -o "$unamestr" = "Cygwin" ]; then michael@0: lsargs="-algR --time-style=+%Y-%m-%d-%H:%M" michael@0: fi michael@0: fi michael@0: michael@0: rm -rf "$workdir" michael@0: mkdir -p "$fromdir" michael@0: mkdir -p "$todir" michael@0: michael@0: cp "$1" "$fromdir" michael@0: cp "$2" "$todir" michael@0: michael@0: cd "$fromdir" michael@0: mar -x "$1" michael@0: rm "$1" michael@0: mv updatev2.manifest updatev2.manifest.bz2 michael@0: bzip2 -d updatev2.manifest.bz2 michael@0: mv updatev3.manifest updatev3.manifest.bz2 michael@0: bzip2 -d updatev3.manifest.bz2 michael@0: ls $lsargs > files.txt michael@0: michael@0: cd "$todir" michael@0: mar -x "$2" michael@0: rm "$2" michael@0: mv updatev2.manifest updatev2.manifest.bz2 michael@0: bzip2 -d updatev2.manifest.bz2 michael@0: mv updatev3.manifest updatev3.manifest.bz2 michael@0: bzip2 -d updatev3.manifest.bz2 michael@0: ls $lsargs > files.txt michael@0: michael@0: echo "diffing $fromdir and $todir" michael@0: echo "on linux shell sort and python sort return different results" michael@0: echo "which can cause differences in the manifest files" michael@0: diff -ru "$fromdir" "$todir"