|
1 #!/bin/bash |
|
2 # Compares two mars |
|
3 |
|
4 marA="$1" |
|
5 marB="$2" |
|
6 testDir="$3" |
|
7 workdir="/tmp/diffmar/$testDir" |
|
8 fromdir="$workdir/0" |
|
9 todir="$workdir/1" |
|
10 |
|
11 # On Windows, creation time can be off by a second or more between the files in |
|
12 # the fromdir and todir due to them being extracted synchronously so use |
|
13 # time-style and exclude seconds from the creation time. |
|
14 lsargs="-algR" |
|
15 unamestr=`uname` |
|
16 if [ ! "$unamestr" = 'Darwin' ]; then |
|
17 unamestr=`uname -o` |
|
18 if [ "$unamestr" = 'Msys' -o "$unamestr" = "Cygwin" ]; then |
|
19 lsargs="-algR --time-style=+%Y-%m-%d-%H:%M" |
|
20 fi |
|
21 fi |
|
22 |
|
23 rm -rf "$workdir" |
|
24 mkdir -p "$fromdir" |
|
25 mkdir -p "$todir" |
|
26 |
|
27 cp "$1" "$fromdir" |
|
28 cp "$2" "$todir" |
|
29 |
|
30 cd "$fromdir" |
|
31 mar -x "$1" |
|
32 rm "$1" |
|
33 mv updatev2.manifest updatev2.manifest.bz2 |
|
34 bzip2 -d updatev2.manifest.bz2 |
|
35 mv updatev3.manifest updatev3.manifest.bz2 |
|
36 bzip2 -d updatev3.manifest.bz2 |
|
37 ls $lsargs > files.txt |
|
38 |
|
39 cd "$todir" |
|
40 mar -x "$2" |
|
41 rm "$2" |
|
42 mv updatev2.manifest updatev2.manifest.bz2 |
|
43 bzip2 -d updatev2.manifest.bz2 |
|
44 mv updatev3.manifest updatev3.manifest.bz2 |
|
45 bzip2 -d updatev3.manifest.bz2 |
|
46 ls $lsargs > files.txt |
|
47 |
|
48 echo "diffing $fromdir and $todir" |
|
49 echo "on linux shell sort and python sort return different results" |
|
50 echo "which can cause differences in the manifest files" |
|
51 diff -ru "$fromdir" "$todir" |